8000 Merge branch 'symfony:7.2' into scheduler-post-run-event-result · symfony/symfony@1705445 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1705445

Browse files
authored
Merge branch 'symfony:7.2' into scheduler-post-run-event-result
2 parents 7349836 + fed083a commit 1705445

File tree

94 files changed

+1624
-234
lines changed
  • Tests/Adapter
  • Lock/Tests/Store
  • Messenger
  • Notifier
  • Scheduler
  • Security/Guard/.github
  • Serializer/Command
  • Validator
  • VarExporter
  • Contracts/Tests/Service
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    94 files changed

    +1624
    -234
    lines changed

    UPGRADE-7.2.md

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -46,6 +46,7 @@ Ldap
    4646
    ----
    4747

    4848
    * Add methods for `saslBind()` and `whoami()` to `ConnectionInterface` and `LdapInterface`
    49+
    * Deprecate the `sizeLimit` option of `AbstractQuery`
    4950

    5051
    Mailer
    5152
    ------

    phpunit.xml.dist

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -34,7 +34,7 @@
    3434
    <directory>./src/Symfony/Component/*/Tests/</directory>
    3535
    <directory>./src/Symfony/Component/*/*/Tests/</directory>
    3636
    <directory>./src/Symfony/Component/*/*/*/Tests/</directory>
    37-
    <directory>./src/Symfony/Contract/*/Tests/</directory>
    37+
    <directory>./src/Symfony/Contracts/*/Tests/</directory>
    3838
    <directory>./src/Symfony/Bundle/*/Tests/</directory>
    3939
    </testsuite>
    4040
    </testsuites>
    @@ -63,7 +63,7 @@
    6363
    <directory>./src/Symfony/Bundle/*/vendor</directory>
    6464
    <directory>./src/Symfony/Component/*/vendor</directory>
    6565
    <directory>./src/Symfony/Component/*/*/vendor</directory>
    66-
    <directory>./src/Symfony/Contract/*/vendor</directory>
    66+
    <directory>./src/Symfony/Contracts/*/vendor</directory>
    6767
    </exclude>
    6868
    </coverage>
    6969

    src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -36,7 +36,7 @@ public function onKernelResponse(ResponseEvent $event): void
    3636
    return;
    3737
    }
    3838

    39-
    if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent'))) {
    39+
    if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent', ''))) {
    4040
    self::$sendHeaders = false;
    4141
    $this->headers = [];
    4242

    Lines changed: 36 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,36 @@
    1+
    <?php
    2+
    3+
    /*
    4+
    * This file is part of the Symfony package.
    5+
    *
    6+
    * (c) Fabien Potencier <fabien@symfony.com>
    7+
    *
    8+
    * For the full copyright and license information, please view the LICENSE
    9+
    * file that was distributed with this source code.
    10+
    */
    11+
    12+
    namespace Symfony\Bridge\Monolog\Tests\Handler;
    13+
    14+
    use PHPUnit\Framework\TestCase;
    15+
    use Symfony\Bridge\Monolog\Handler\ChromePhpHandler;
    16+
    use Symfony\Component\HttpFoundation\Request;
    17+
    use Symfony\Component\HttpFoundation\Response;
    18+
    use Symfony\Component\HttpKernel\Event\ResponseEvent;
    19+
    use Symfony\Component\HttpKernel\HttpKernelInterface;
    20+
    21+
    class ChromePhpHandlerTest extends TestCase
    22+
    {
    23+
    public function testOnKernelResponseShouldNotTriggerDeprecation()
    24+
    {
    25+
    $this->expectNotToPerformAssertions();
    26+
    27+
    $request = Request::create('/');
    28+
    $request->headers->remove('User-Agent');
    29+
    30+
    $response = new Response('foo');
    31+
    $event = new ResponseEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST, $response);
    32+
    33+
    $listener = new ChromePhpHandler();
    34+
    $listener->onKernelResponse($event);
    35+
    }
    36+
    }

    src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php

    Lines changed: 1 addition & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -68,11 +68,7 @@ public function testVerbosityMapping($verbosity, $level, $isHandling, array $map
    6868

    6969
    $realOutput = $this->getMockBuilder(Output::class)->onlyMethods(['doWrite'])->getMock();
    7070
    $realOutput->setVerbosity($verbosity);
    71-
    if ($realOutput->isDebug()) {
    72-
    $log = "16:21:54 $levelName [app] My info message\n";
    73-
    } else {
    74-
    $log = "16:21:54 $levelName [app] My info message\n";
    75-
    }
    71+
    $log = "16:21:54 $levelName [app] My info message\n";
    7672
    $realOutput
    7773
    ->expects($isHandling ? $this->once() : $this->never())
    7874
    ->method('doWrite')

    src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -113,9 +113,6 @@ protected function configure(): void
    113113

    114114
    protected function execute(InputInterface $input, OutputInterface $output): int
    115115
    {
    116-
    $io = new SymfonyStyle($input, $output);
    117-
    $errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
    118-
    119116
    $io = new SymfonyStyle($input, $output);
    120117
    $errorIo = $io->getErrorStyle();
    121118

    src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

    Lines changed: 3 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -2839,6 +2839,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
    28392839
    NotifierBridge\JoliNotif\JoliNotifTransportFactory::class => 'notifier.transport_factory.joli-notif',
    28402840
    NotifierBridge\KazInfoTeh\KazInfoTehTransportFactory::class => 'notifier.transport_factory.kaz-info-teh',
    28412841
    NotifierBridge\LightSms\LightSmsTransportFactory::class => 'notifier.transport_factory.light-sms',
    2842+
    NotifierBridge\LineBot\LineBotTransportFactory::class => 'notifier.transport_factory.line-bot',
    28422843
    NotifierBridge\LineNotify\LineNotifyTransportFactory::class => 'notifier.transport_factory.line-notify',
    28432844
    NotifierBridge\LinkedIn\LinkedInTransportFactory::class => 'notifier.transport_factory.linked-in',
    28442845
    NotifierBridge\Lox24\Lox24TransportFactory::class => 'notifier.transport_factory.lox24',
    @@ -2880,6 +2881,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
    28802881
    NotifierBridge\SmsSluzba\SmsSluzbaTransportFactory::class => 'notifier.transport_factory.sms-sluzba',
    28812882
    NotifierBridge\Smsense\SmsenseTransportFactory::class => 'notifier.transport_factory.smsense',
    28822883
    NotifierBridge\SpotHit\SpotHitTransportFactory::class => 'notifier.transport_factory.spot-hit',
    2884+
    NotifierBridge\Sweego\SweegoTransportFactory::class => 'notifier.transport_factory.sweego',
    28832885
    NotifierBridge\Telegram\TelegramTransportFactory::class => 'notifier.transport_factory.telegram',
    28842886
    NotifierBridge\Telnyx\TelnyxTransportFactory::class => 'notifier.transport_factory.telnyx',
    28852887
    NotifierBridge\Termii\TermiiTransportFactory::class => 'notifier.transport_factory.termii',
    @@ -2947,6 +2949,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
    29472949
    $loader->load('notifier_webhook.php');
    29482950

    29492951
    $webhookRequestParsers = [
    2952+
    NotifierBridge\Sweego\Webhook\SweegoRequestParser::class => 'notifier.webhook.request_parser.sweego',
    29502953
    NotifierBridge\Twilio\Webhook\TwilioRequestParser::class => 'notifier.webhook.request_parser.twilio',
    29512954
    NotifierBridge\Vonage\Webhook\VonageRequestParser::class => 'notifier.webhook.request_parser.vonage',
    29522955
    ];

    src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_transports.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -32,6 +32,7 @@
    3232
    'fake-chat' => Bridge\FakeChat\FakeChatTransportFactory::class,
    3333
    'firebase' => Bridge\Firebase\FirebaseTransportFactory::class,
    3434
    'google-chat' => Bridge\GoogleChat\GoogleChatTransportFactory::class,
    35+
    'line-bot' => Bridge\LineBot\LineBotTransportFactory::class,
    3536
    'line-notify' => Bridge\LineNotify\LineNotifyTransportFactory::class,
    3637
    'linked-in' => Bridge\LinkedIn\LinkedInTransportFactory::class,
    3738
    'mastodon' => Bridge\Mastodon\MastodonTransportFactory::class,
    @@ -107,6 +108,7 @@
    107108
    'smsense' => Bridge\Smsense\SmsenseTransportFactory::class,
    108109
    'smsmode' => Bridge\Smsmode\SmsmodeTransportFactory::class,
    109110
    'spot-hit' => Bridge\SpotHit\SpotHitTransportFactory::class,
    111+
    'sweego' => Bridge\Sweego\SweegoTransportFactory::class,
    110112
    'telnyx' => Bridge\Telnyx\TelnyxTransportFactory::class,
    111113
    'termii' => Bridge\Termii\TermiiTransportFactory::class,
    112114
    'turbo-sms' => Bridge\TurboSms\TurboSmsTransportFactory::class,

    src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_webhook.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,11 +11,15 @@
    1111

    1212
    namespace Symfony\Component\DependencyInjection\Loader\Configurator;
    1313

    14+
    use Symfony\Component\Notifier\Bridge\Sweego\Webhook\SweegoRequestParser;
    1415
    use Symfony\Component\Notifier\Bridge\Twilio\Webhook\TwilioRequestParser;
    1516
    use Symfony\Component\Notifier\Bridge\Vonage\Webhook\VonageRequestParser;
    1617

    1718
    return static function (ContainerConfigurator $container) {
    1819
    $container->services()
    20+
    ->set('notifier.webhook.request_parser.sweego', SweegoRequestParser::class)
    21+
    ->alias(SweegoRequestParser::class, 'notifier.webhook.request_parser.sweego')
    22+
    1923
    ->set('notifier.webhook.request_parser.twilio', TwilioRequestParser::class)
    2024
    ->alias(TwilioRequestParser::class, 'notifier.webhook.request_parser.twilio')
    2125

    src/Symfony/Bundle/FrameworkBundle/Tests/Test/WebTestCaseTest.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -388,7 +388,7 @@ private function getRequestTester(): WebTestCase
    388388

    389389
    private function getTester(KernelBrowser $client): WebTestCase
    390390
    {
    391-
    $tester = new class extends WebTestCase {
    391+
    $tester = new class(method_exists($this, 'name') ? $this->name() : $this->getName()) extends WebTestCase {
    392392
    use WebTestAssertionsTrait {
    393393
    getClient as public;
    394394
    }

    src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -73,7 +73,7 @@ public static function provideCreateConnection(): array
    7373
    'Redis',
    7474
    ],
    7575
    [
    76-
    'dsn' => \sprintf('redis:?%s', implode('&', \array_slice($hosts, 0, 2))),
    76+
    \sprintf('redis:?%s', implode('&', \array_slice($hosts, 0, 2))),
    7777
    'RedisArray',
    7878
    ],
    7979
    ];

    src/Symfony/Component/Console/Application.php

    Lines changed: 8 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -139,6 +139,14 @@ public function setAlarmInterval(?int $seconds): void
    139139
    $this->scheduleAlarm();
    140140
    }
    141141

    142+
    /**
    143+
    * Gets the interval in seconds on which a SIGALRM signal is dispatched.
    144+
    */
    145+
    public function getAlarmInterval(): ?int
    146+
    {
    147+
    return $this->alarmInterval;
    148+
    }
    149+
    142150
    private function scheduleAlarm(): void
    143151
    {
    144152
    if (null !== $this->alarmInterval) {

    src/Symfony/Component/Console/Completion/CompletionInput.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -123,13 +123,13 @@ public function bind(InputDefinition $definition): void
    123123
    if ($this->currentIndex >= \count($this->tokens)) {
    124124
    if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) {
    125125
    $this->completionName = $argumentName;
    126-
    $this->completionValue = '';
    127126
    } else {
    128127
    // we've reached the end
    129128
    $this->completionType = self::TYPE_NONE;
    130129
    $this->completionName = null;
    131-
    $this->completionValue = '';
    132130
    }
    131+
    132+
    $this->completionValue = '';
    133133
    }
    134134
    }
    135135

    src/Symfony/Component/Console/Tests/ApplicationTest.php

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -2305,6 +2305,7 @@ public function testAlarmDispatchWithoutEventDispatcher()
    23052305
    $application = $this->createSignalableApplication($command, null);
    23062306

    23072307
    $this->assertSame(1, $application->run(new ArrayInput(['alarm'])));
    2308+
    $this->assertSame(1, $application->getAlarmInterval());
    23082309
    $this->assertTrue($command->signaled);
    23092310
    }
    23102311

    src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php

    Lines changed: 1 addition & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -151,11 +151,7 @@ public function testContextReplacement()
    151151

    152152
    public function testObjectCastToString()
    153153
    {
    154-
    if (method_exists($this, 'createPartialMock')) {
    155-
    $dummy = $this->createPartialMock(DummyTest::class, ['__toString']);
    156-
    } else {
    157-
    $dummy = $this->createPartialMock(DummyTest::class, ['__toString']);
    158-
    }
    154+
    $dummy = $this->createPartialMock(DummyTest::class, ['__toString']);
    159155
    $dummy->method('__toString')->willReturn('DUMMY');
    160156

    161157
    $this->getLogger()->warning($dummy);

    src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

    Lines changed: 1 addition & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1139,16 +1139,15 @@ private function addNewInstance(Definition $definition, string $return = '', ?st
    11391139
    {
    11401140
    $tail = $return ? str_repeat(')', substr_count($return, '(') - substr_count($return, ')')).";\n" : '';
    11411141

    1142+
    $arguments = [];
    11421143
    if (BaseServiceLocator::class === $definition->getClass() && $definition->hasTag($this->serviceLocatorTag)) {
    1143-
    $arguments = [];
    11441144
    foreach ($definition->getArgument(0) as $k => $argument) {
    11451145
    $arguments[$k] = $argument->getValues()[0];
    11461146
    }
    11471147

    11481148
    return $return.$this->dumpValue(new ServiceLocatorArgument($arguments)).$tail;
    11491149
    }
    11501150

    1151-
    $arguments = [];
    11521151
    foreach ($definition->getArguments() as $i => $value) {
    11531152
    $arguments[] = (\is_string($i) ? $i.': ' : '').$this->dumpValue($value);
    11541153
    }

    src/Symfony/Component/DomCrawler/Form.php

    Lines changed: 4 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -421,16 +421,14 @@ private function initialize(): void
    421421
    $formId = Crawler::xpathLiteral($this->node->getAttribute('id'));
    422422

    423423
    $fieldNodes = $xpath->query(\sprintf('( descendant::input[@form=%s] | descendant::button[@form=%1$s] | descendant::textarea[@form=%1$s] | descendant::select[@form=%1$s] | //form[@id=%1$s]//input[not(@form)] | //form[@id=%1$s]//button[not(@form)] | //form[@id=%1$s]//textarea[not(@form)] | //form[@id=%1$s]//select[not(@form)] )[( not(ancestor::template) or ancestor::turbo-stream )]', $formId));
    424-
    foreach ($fieldNodes as $node) {
    425-
    $this->addField($node);
    426-
    }
    427424
    } else {
    428425
    // do the xpath query with $this->node as the context node, to only find descendant elements
    429426
    // however, descendant elements with form attribute are not part of this form
    430427
    $fieldNodes = $xpath->query('( descendant::input[not(@form)] | descendant::button[not(@form)] | descendant::textarea[not(@form)] | descendant::select[not(@form)] )[( not(ancestor::template) or ancestor::turbo-stream )]', $this->node);
    431-
    foreach ($fieldNodes as $node) {
    432-
    $this->addField($node);
    433-
    }
    428+
    }
    429+
    430+
    foreach ($fieldNodes as $node) {
    431+
    $this->addField($node);
    434432
    }
    435433

    436434
    if ($this->baseHref && '' !== $this->node->getAttribute('action')) {

    src/Symfony/Component/ErrorHandler/DebugClassLoader.php

    Lines changed: 25 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -849,6 +849,30 @@ private function setReturnType(string $types, string $class, string $method, str
    849849
    $docTypes = [];
    850850

    851851
    foreach ($typesMap as $n => $t) {
    852+
    if (str_contains($n, '::')) {
    853+
    [$definingClass, $constantName] = explode('::', $n, 2);
    854+
    $definingClass = match ($definingClass) {
    855+
    'self', 'static', 'parent' => $class,
    856+
    default => $definingClass,
    857+
    };
    858+
    859+
    if (!\defined($definingClass.'::'.$constantName)) {
    860+
    return;
    861+
    }
    862+
    863+
    $constant = new \ReflectionClassConstant($definingClass, $constantName);
    864+
    865+
    if (\PHP_VERSION_ID >= 80300 && $constantType = $constant->getType()) {
    866+
    if ($constantType instanceof \ReflectionNamedType) {
    867+
    $n = $constantType->getName();
    868+
    } else {
    869+
    return;
    870+
    }
    871+
    } else {
    872+
    $n = \gettype($constant->getValue());
    873+
    }
    874+
    }
    875+
    852876
    if ('null' === $n) {
    853877
    $nullable = true;
    854878
    continue;
    @@ -872,7 +896,7 @@ private function setReturnType(string $types, string $class, string $method, str
    872896
    continue;
    873897
    }
    874898

    875-
    if (!isset($phpTypes[''])) {
    899+
    if (!isset($phpTypes['']) && !\in_array($n, $phpTypes, true)) {
    876900
    $phpTypes[] = $n;
    877901
    }
    878902
    }

    src/Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php

    Lines changed: 22 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -401,6 +401,26 @@ class_exists('Test\\'.ReturnType::class, true);
    401401
    'Method "Symfony\Component\ErrorHandler\Tests\Fixtures\ReturnTypeParent::true()" might add "true" as a native return type declaration in the future. Do the same in child class "Test\Symfony\Component\ErrorHandler\Tests\ReturnType" now to avoid errors or add an explicit @return annotation to suppress this message.',
    402402
    'Method "Symfony\Component\ErrorHandler\Tests\Fixtures\ReturnTypeParent::never()" might add "never" as a native return type declaration in the future. Do the same in child class "Test\Symfony\Component\ErrorHandler\Tests\ReturnType" now to avoid errors or add an explicit @return annotation to suppress this message.',
    403403
    'Method "Symfony\Component\ErrorHandler\Tests\Fixtures\ReturnTypeParent::null()" might add "null" as a native return type declaration in the future. Do the same in child class "Test\Symfony\Component\ErrorHandler\Tests\ReturnType" now to avoid errors or add an explicit @return annotation to suppress this message.',
    404+
    'Method "Symfony\Component\ErrorHandler\Tests\Fixtures\ReturnTypeParent::classConstant()" might add "string" as a native return type declaration in the future. Do the same in child class "Test\Symfony\Component\ErrorHandler\Tests\ReturnType" now to avoid errors or add an explicit @return annotation to suppress this message.',
    405+
    ], $deprecations);
    406+
    }
    407+
    408+
    /**
    409+
    * @requires PHP >= 8.3
    410+
    */
    411+
    public function testReturnTypePhp83()
    412+
    {
    413+
    $deprecations = [];
    414+
    set_error_handler(function ($type, $msg) use (&$deprecations) { $deprecations[] = $msg; });
    415+
    $e = error_reporting(E_USER_DEPRECATED);
    416+
    417+
    class_exists('Test\\'.ReturnTypePhp83::class, true);
    418+
    419+
    error_reporting($e);
    420+
    restore_error_handler();
    421+
    422+
    $this->assertSame([
    423+
    'Method "Symfony\Component\ErrorHandler\Tests\Fixtures\ReturnTypeParentPhp83::classConstantWithType()" might add "string" as a native return type declaration in the future. Do the same in child class "Test\Symfony\Component\ErrorHandler\Tests\ReturnTypePhp83" now to avoid errors or add an explicit @return annotation to suppress this message.',
    404424
    ], $deprecations);
    405425
    }
    406426

    @@ -542,6 +562,8 @@ public function ownAbstractBaseMethod() { }
    542562
    }');
    543563
    } elseif ('Test\\'.ReturnType::class === $class) {
    544564
    return $fixtureDir.\DIRECTORY_SEPARATOR.'ReturnType.php';
    565+
    } elseif ('Test\\'.ReturnTypePhp83::class === $class) {
    566+
    return $fixtureDir.\DIRECTORY_SEPARATOR.'ReturnTypePhp83.php';
    545567
    } elseif ('Test\\'.Fixtures\OutsideInterface::class === $class) {
    546568
    return $fixtureDir.\DIRECTORY_SEPARATOR.'OutsideInterface.php';
    547569
    } elseif ('Test\\'.OverrideOutsideFinalProperty::class === $class) {

    src/Symfony/Component/ErrorHandler/Tests/Fixtures/ReturnType.php

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -51,4 +51,5 @@ public function true() { }
    5151
    public function never() { }
    5252
    public function null() { }
    5353
    public function outsideMethod() { }
    54+
    public function classConstant() { }
    5455
    }

    src/Symfony/Component/ErrorHandler/Tests/Fixtures/ReturnTypeParent.php

    Lines changed: 9 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -4,6 +4,8 @@
    44

    55
    abstract class ReturnTypeParent extends ReturnTypeGrandParent implements ReturnTypeParentInterface
    66
    {
    7+
    const FOO = 'foo';
    8+
    79
    /**
    810
    * @return void
    911
    */
    @@ -254,4 +256,11 @@ public function null()
    254256
    public function notExtended()
    255257
    {
    256258
    }
    259+
    260+
    /**
    261+
    * @return self::FOO
    262+
    */
    263+
    public function classConstant()
    264+
    {
    265+
    }
    257266
    }
    Lines changed: 23 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,23 @@
    1+
    <?php
    2+
    3+
    namespace Symfony\Component\ErrorHandler\Tests\Fixtures;
    4+
    5+
    abstract class ReturnTypeParentPhp83
    6+
    {
    7+
    const string FOO = 'foo';
    8+
    const string|int BAR = 'bar';
    9+
    10+
    /**
    11+
    * @return self::FOO
    12+
    */
    13+
    public function classConstantWithType()
    14+
    {
    15+
    }
    16+
    17+
    /**
    18+
    * @return self::BAR
    19+
    */
    20+
    public function classConstantWithUnionType()
    21+
    {
    22+
    }
    23+
    }
    Lines changed: 11 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,11 @@
    1+
    <?php
    2+
    3+
    namespace Test\Symfony\Component\ErrorHandler\Tests;
    4+
    5+
    use Symfony\Component\ErrorHandler\Tests\Fixtures\ReturnTypeParentPhp83;
    6+
    7+
    class ReturnTypePhp83 extends ReturnTypeParentPhp83
    8+
    {
    9+
    public function classConstantWithType() { }
    10+
    public function classConstantWithUnionType() { }
    11+
    }

    0 commit comments

    Comments
     (0)
    0