From 732fbe800069c1ac35185fc5612c59ad22365550 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 12 Jul 2025 11:35:41 +0200 Subject: [PATCH] Fix @var phpdoc --- .php-cs-fixer.dist.php | 1 + .../Tests/LazyProxy/ContainerBuilderTest.php | 2 +- .../Instantiator/RuntimeInstantiatorTest.php | 2 +- .../Bridge/Twig/Extension/FormExtension.php | 2 +- .../Controller/AbstractControllerTest.php | 12 +- .../Bundle/TestBundle/TestBundle.php | 2 +- .../Resolver/JsDelivrEsmResolver.php | 2 +- .../Tests/ImportMap/ImportMapManagerTest.php | 2 +- .../Tests/Formatter/OutputFormatterTest.php | 2 +- .../Tests/ContainerBuilderTest.php | 2 +- .../Validator/Constraints/FormValidator.php | 2 +- .../Validator/ValidatorExtension.php | 2 +- .../ViolationMapper/ViolationMapper.php | 4 +- src/Symfony/Component/Form/FormBuilder.php | 2 +- .../Component/Form/FormErrorIterator.php | 2 +- .../Component/Form/ResolvedFormType.php | 2 +- .../Component/Form/Tests/SimpleFormTest.php | 2 +- .../HttpClient/Response/AmpResponse.php | 2 +- .../HttpClient/Tests/MockHttpClientTest.php | 2 +- .../MessengerTransportListenerTest.php | 4 +- .../Transport/AmqpExtIntegrationTest.php | 4 +- .../Middleware/RouterContextMiddleware.php | 2 +- ...dMessageToFailureTransportListenerTest.php | 4 +- .../Middleware/SendMessageMiddlewareTest.php | 2 +- .../Tests/OptionsResolverTest.php | 4 +- .../Component/PropertyAccess/PropertyPath.php | 2 +- .../Extractor/PhpDocExtractor.php | 6 +- .../Bridge/Crowdin/CrowdinProvider.php | 2 +- .../Validator/Constraints/Composite.php | 4 +- .../Validator/RecursiveValidatorTest.php | 104 +++++++++--------- .../RecursiveContextualValidator.php | 2 +- .../Service/ServiceSubscriberTrait.php | 2 +- 32 files changed, 96 insertions(+), 95 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 8136d4ae6e98c..680fa4709e6ec 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -30,6 +30,7 @@ '@PHPUnit75Migration:risky' => true, '@Symfony' => true, '@Symfony:risky' => true, + 'phpdoc_var_annotation_correct_order' => true, 'protected_to_private' => false, 'no_superfluous_phpdoc_tags' => [ 'remove_inheritdoc' => true, diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php index 38febd80b4df6..63a4f975be116 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php @@ -38,7 +38,7 @@ public function testCreateProxyServiceWithRuntimeInstantiator() $builder->compile(); - /* @var $foo1 \ProxyManager\Proxy\LazyLoadingInterface|\ProxyManager\Proxy\ValueHolderInterface */ + /** @var \ProxyManager\Proxy\LazyLoadingInterface|\ProxyManager\Proxy\ValueHolderInterface $foo1 */ $foo1 = $builder->get('foo1'); $foo1->__destruct(); diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php index c0bbf65d65769..da9c47cf3901d 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php @@ -41,7 +41,7 @@ public function testInstantiateProxy() $definition = new Definition('stdClass'); $instantiator = fn () => $instance; - /* @var $proxy LazyLoadingInterface|ValueHolderInterface */ + /** @var LazyLoadingInterface|ValueHolderInterface $proxy */ $proxy = $this->instantiator->instantiateProxy($container, $definition, 'foo', $instantiator); $this->assertInstanceOf(LazyLoadingInterface::class, $proxy); diff --git a/src/Symfony/Bridge/Twig/Extension/FormExtension.php b/src/Symfony/Bridge/Twig/Extension/FormExtension.php index 01f65ec202bee..e1abdca7eb48e 100644 --- a/src/Symfony/Bridge/Twig/Extension/FormExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/FormExtension.php @@ -157,7 +157,7 @@ private function createFieldChoicesList(iterable $choices, string|false|null $tr continue; } - /* @var ChoiceView $choice */ + /** @var ChoiceView $choice */ $translatableLabel = $this->createFieldTranslation($choice->label, $choice->labelTranslationParameters, $translationDomain); yield $translatableLabel => $choice->value; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php index f806c540b278b..a5d0e4bca012e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php @@ -233,7 +233,7 @@ public function testFile() $controller = $this->createController(); $controller->setContainer($container); - /* @var BinaryFileResponse $response */ + /** @var BinaryFileResponse $response */ $response = $controller->file(new File(__FILE__)); $this->assertInstanceOf(BinaryFileResponse::class, $response); $this->assertSame(200, $response->getStatusCode()); @@ -248,7 +248,7 @@ public function testFileAsInline() { $controller = $this->createController(); - /* @var BinaryFileResponse $response */ + /** @var BinaryFileResponse $response */ $response = $controller->file(new File(__FILE__), null, ResponseHeaderBag::DISPOSITION_INLINE); $this->assertInstanceOf(BinaryFileResponse::class, $response); @@ -264,7 +264,7 @@ public function testFileWithOwnFileName() { $controller = $this->createController(); - /* @var BinaryFileResponse $response */ + /** @var BinaryFileResponse $response */ $fileName = 'test.php'; $response = $controller->file(new File(__FILE__), $fileName); @@ -281,7 +281,7 @@ public function testFileWithOwnFileNameAsInline() { $controller = $this->createController(); - /* @var BinaryFileResponse $response */ + /** @var BinaryFileResponse $response */ $fileName = 'test.php'; $response = $controller->file(new File(__FILE__), $fileName, ResponseHeaderBag::DISPOSITION_INLINE); @@ -298,7 +298,7 @@ public function testFileFromPath() { $controller = $this->createController(); - /* @var BinaryFileResponse $response */ + /** @var BinaryFileResponse $response */ $response = $controller->file(__FILE__); $this->assertInstanceOf(BinaryFileResponse::class, $response); @@ -314,7 +314,7 @@ public function testFileFromPathWithCustomizedFileName() { $controller = $this->createController(); - /* @var BinaryFileResponse $response */ + /** @var BinaryFileResponse $response */ $response = $controller->file(__FILE__, 'test.php'); $this->assertInstanceOf(BinaryFileResponse::class, $response); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php index d0c6588b00568..73cb63d1fe259 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php @@ -24,7 +24,7 @@ public function build(ContainerBuilder $container): void { parent::build($container); - /** @var $extension DependencyInjection\TestExtension */ + /** @var DependencyInjection\TestExtension $extension */ $extension = $container->getExtension('test'); if (!$container->getParameterBag() instanceof FrozenParameterBag) { diff --git a/src/Symfony/Component/AssetMapper/ImportMap/Resolver/JsDelivrEsmResolver.php b/src/Symfony/Component/AssetMapper/ImportMap/Resolver/JsDelivrEsmResolver.php index b88f0e792d44f..e0de404e77094 100644 --- a/src/Symfony/Component/AssetMapper/ImportMap/Resolver/JsDelivrEsmResolver.php +++ b/src/Symfony/Component/AssetMapper/ImportMap/Resolver/JsDelivrEsmResolver.php @@ -196,7 +196,7 @@ public function downloadPackages(array $importMapEntries, ?callable $progressCal $dependencies = []; $extraFiles = []; - /* @var ImportMapEntry $entry */ + /** @var ImportMapEntry $entry */ $contents[$package] = [ 'content' => $this->makeImportsBare($response->getContent(), $dependencies, $extraFiles, $entry->type, $entry->getPackagePathString()), 'dependencies' => $dependencies, diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php index 65de2a2efbe1d..7762c2216df22 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php @@ -248,7 +248,7 @@ public function testUpdateAll() ->method('resolvePackages') ->with($this->callback(function ($packages) { $this->assertInstanceOf(PackageRequireOptions::class, $packages[0]); - /* @var PackageRequireOptions[] $packages */ + /** @var PackageRequireOptions[] $packages */ $this->assertCount(2, $packages); $this->assertSame('lodash', $packages[0]->packageModuleSpecifier); diff --git a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php index 477f1bdf6bd70..eb8e483f3033b 100644 --- a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php +++ b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php @@ -177,7 +177,7 @@ public function testInlineStyleOptions(string $tag, ?string $expected = null, ?s $expected = $tag.$input.''; $this->assertSame($expected, $formatter->format($expected)); } else { - /* @var OutputFormatterStyle $result */ + /** @var OutputFormatterStyle $result */ $this->assertInstanceOf(OutputFormatterStyle::class, $result); $this->assertSame($expected, $formatter->format($tag.$input.'')); $this->assertSame($expected, $formatter->format($tag.$input.'')); diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index 5c296bfd5a472..b8e4bd0163d17 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -1128,7 +1128,7 @@ public function testAddObjectResource() $this->assertCount(1, $resources); - /* @var $resource \Symfony\Component\Config\Resource\FileResource */ + /** @var \Symfony\Component\Config\Resource\FileResource $resource */ $resource = end($resources); $this->assertInstanceOf(FileResource::class, $resource); diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php index 2e3748df91306..944fc2d6bed1a 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php @@ -42,7 +42,7 @@ public function validate(mixed $form, Constraint $formConstraint) return; } - /* @var FormInterface $form */ + /** @var FormInterface $form */ $config = $form->getConfig(); $validator = $this->context->getValidator()->inContext($this->context); diff --git a/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php b/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php index d7745be073e12..51ba5258ee377 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php +++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php @@ -43,7 +43,7 @@ public function __construct(ValidatorInterface $validator, bool $legacyErrorMess // the DIC, where the XML file is loaded automatically. Thus the following // code must be kept synchronized with validation.xml - /* @var $metadata ClassMetadata */ + /** @var ClassMetadata $metadata */ $metadata->addConstraint(new Form()); $metadata->addConstraint(new Traverse(false)); diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php index fd53697b139ff..ccad21fef32a4 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php @@ -253,7 +253,7 @@ private function matchChild(FormInterface $form, PropertyPathIteratorInterface $ // Test mapping rules as long as we have any foreach ($rules as $key => $rule) { - /* @var MappingRule $rule */ + /** @var MappingRule $rule */ // Mapping rule matches completely, terminate. if (null !== ($form = $rule->match($chunk))) { @@ -317,7 +317,7 @@ private function reconstructPath(ViolationPath $violationPath, FormInterface $or // Cut the piece out of the property path and proceed $propertyPathBuilder->remove($i); } else { - /* @var \Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath */ + /** @var \Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath */ $propertyPath = $scope->getPropertyPath(); if (null === $propertyPath) { diff --git a/src/Symfony/Component/Form/FormBuilder.php b/src/Symfony/Component/Form/FormBuilder.php index f405c8118e9af..3c0f4e2179226 100644 --- a/src/Symfony/Component/Form/FormBuilder.php +++ b/src/Symfony/Component/Form/FormBuilder.php @@ -147,7 +147,7 @@ public function count(): int public function getFormConfig(): FormConfigInterface { - /** @var $config self */ + /** @var self $config */ $config = parent::getFormConfig(); $config->children = []; diff --git a/src/Symfony/Component/Form/FormErrorIterator.php b/src/Symfony/Component/Form/FormErrorIterator.php index ded0bbed79cf1..e563c9b2de5d0 100644 --- a/src/Symfony/Component/Form/FormErrorIterator.php +++ b/src/Symfony/Component/Form/FormErrorIterator.php @@ -77,7 +77,7 @@ public function __toString(): string if ($error instanceof FormError) { $string .= 'ERROR: '.$error->getMessage()."\n"; } else { - /* @var self $error */ + /** @var self $error */ $string .= $error->getForm()->getName().":\n"; $string .= self::indent((string) $error); } diff --git a/src/Symfony/Component/Form/ResolvedFormType.php b/src/Symfony/Component/Form/ResolvedFormType.php index 16a175fc41683..84921b4f6251e 100644 --- a/src/Symfony/Component/Form/ResolvedFormType.php +++ b/src/Symfony/Component/Form/ResolvedFormType.php @@ -130,7 +130,7 @@ public function finishView(FormView $view, FormInterface $form, array $options) $this->innerType->finishView($view, $form, $options); foreach ($this->typeExtensions as $extension) { - /* @var FormTypeExtensionInterface $extension */ + /** @var FormTypeExtensionInterface $extension */ $extension->finishView($view, $form, $options); } } diff --git a/src/Symfony/Component/Form/Tests/SimpleFormTest.php b/src/Symfony/Component/Form/Tests/SimpleFormTest.php index d5d3549d2a8f6..0f9a6dc41c6a6 100644 --- a/src/Symfony/Component/Form/Tests/SimpleFormTest.php +++ b/src/Symfony/Component/Form/Tests/SimpleFormTest.php @@ -1052,7 +1052,7 @@ public function testInitializeSetsDefaultData() $config = $this->getBuilder()->setData('DEFAULT')->getFormConfig(); $form = new Form($config); - /* @var Form $form */ + /** @var Form $form */ $form->initialize(); $this->assertSame('DEFAULT', $form->getData()); diff --git a/src/Symfony/Component/HttpClient/Response/AmpResponse.php b/src/Symfony/Component/HttpClient/Response/AmpResponse.php index 151fa79b5dd6a..3983cd80f96c3 100644 --- a/src/Symfony/Component/HttpClient/Response/AmpResponse.php +++ b/src/Symfony/Component/HttpClient/Response/AmpResponse.php @@ -222,7 +222,7 @@ private static function generateResponse(Request $request, AmpClientState $multi }); try { - /* @var Response $response */ + /** @var Response $response */ if (null === $response = yield from self::getPushedResponse($request, $multi, $info, $headers, $options, $logger)) { $logger?->info(\sprintf('Request: "%s %s"', $info['http_method'], $info['url'])); diff --git a/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php b/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php index bd28d03e03fb8..e4532010a7154 100644 --- a/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php @@ -501,7 +501,7 @@ public function testHttp2PushVulcainWithUnusedResponse() public function testChangeResponseFactory() { - /* @var MockHttpClient $client */ + /** @var MockHttpClient $client */ $client = $this->getHttpClient(__METHOD__); $expectedBody = '{"foo": "bar"}'; $client->setResponseFactory(new MockResponse($expectedBody)); diff --git a/src/Symfony/Component/Mailer/Tests/EventListener/MessengerTransportListenerTest.php b/src/Symfony/Component/Mailer/Tests/EventListener/MessengerTransportListenerTest.php index d2627bd030271..e1d84753de1a1 100644 --- a/src/Symfony/Component/Mailer/Tests/EventListener/MessengerTransportListenerTest.php +++ b/src/Symfony/Component/Mailer/Tests/EventListener/MessengerTransportListenerTest.php @@ -41,7 +41,7 @@ public function testMessengerTransportStampViaHeader() $event = new MessageEvent($message, $envelope, 'smtp', true); $l->onMessage($event); $this->assertCount(1, $event->getStamps()); - /* @var TransportNamesStamp $stamp */ + /** @var TransportNamesStamp $stamp */ $this->assertInstanceOf(TransportNamesStamp::class, $stamp = $event->getStamps()[0]); $this->assertSame(['async'], $stamp->getTransportNames()); $this->assertFalse($message->getHeaders()->has('X-Bus-Transport')); @@ -57,7 +57,7 @@ public function testMessengerTransportStampsViaHeader() $event = new MessageEvent($message, $envelope, 'smtp', true); $l->onMessage($event); $this->assertCount(1, $event->getStamps()); - /* @var TransportNamesStamp $stamp */ + /** @var TransportNamesStamp $stamp */ $this->assertInstanceOf(TransportNamesStamp::class, $stamp = $event->getStamps()[0]); $this->assertSame(['async', 'async1', $name], $stamp->getTransportNames()); $this->assertFalse($message->getHeaders()->has('X-Bus-Transport')); diff --git a/src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpExtIntegrationTest.php b/src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpExtIntegrationTest.php index cfa93698bacf5..2ccaa4cddbe14 100644 --- a/src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpExtIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpExtIntegrationTest.php @@ -116,7 +116,7 @@ public function testRetryAndDelay() // this should be the custom routing key message first $this->assertCount(1, $envelopes); - /* @var Envelope $envelope */ + /** @var Envelope $envelope */ $receiver->ack($envelopes[0]); $this->assertEquals($customRoutingKeyMessage, $envelopes[0]->getMessage()); @@ -125,7 +125,7 @@ public function testRetryAndDelay() // duration should be about 2 seconds $this->assertApproximateDuration($startTime, 2); - /* @var RedeliveryStamp|null $retryStamp */ + /** @var RedeliveryStamp|null $retryStamp */ // verify the stamp still exists from the last send $this->assertCount(1, $envelopes); $retryStamp = $envelopes[0]->last(RedeliveryStamp::class); diff --git a/src/Symfony/Component/Messenger/Middleware/RouterContextMiddleware.php b/src/Symfony/Component/Messenger/Middleware/RouterContextMiddleware.php index 742ef30b4d397..effad81dbf377 100644 --- a/src/Symfony/Component/Messenger/Middleware/RouterContextMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/RouterContextMiddleware.php @@ -58,7 +58,7 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope $currentPathInfo = $context->getPathInfo(); $currentQueryString = $context->getQueryString(); - /* @var RouterContextStamp $contextStamp */ + /** @var RouterContextStamp $contextStamp */ $context ->setBaseUrl($contextStamp->getBaseUrl()) ->setMethod($contextStamp->getMethod()) diff --git a/src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageToFailureTransportListenerTest.php b/src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageToFailureTransportListenerTest.php index 9060ff515ed84..a6473e6c1a8a1 100644 --- a/src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageToFailureTransportListenerTest.php +++ b/src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageToFailureTransportListenerTest.php @@ -26,7 +26,7 @@ public function testItSendsToTheFailureTransportWithSenderLocator() $receiverName = 'my_receiver'; $sender = $this->createMock(SenderInterface::class); $sender->expects($this->once())->method('send')->with($this->callback(function ($envelope) use ($receiverName) { - /* @var Envelope $envelope */ + /** @var Envelope $envelope */ $this->assertInstanceOf(Envelope::class, $envelope); /** @var SentToFailureTransportStamp $sentToFailureTransportStamp */ @@ -101,7 +101,7 @@ public function testItSendsToTheFailureTransportWithMultipleFailedTransports() $receiverName = 'my_receiver'; $sender = $this->createMock(SenderInterface::class); $sender->expects($this->once())->method('send')->with($this->callback(function ($envelope) use ($receiverName) { - /* @var Envelope $envelope */ + /** @var Envelope $envelope */ $this->assertInstanceOf(Envelope::class, $envelope); /** @var SentToFailureTransportStamp $sentToFailureTransportStamp */ diff --git a/src/Symfony/Component/Messenger/Tests/Middleware/SendMessageMiddlewareTest.php b/src/Symfony/Component/Messenger/Tests/Middleware/SendMessageMiddlewareTest.php index df402764c1e98..280e019a1ea61 100644 --- a/src/Symfony/Component/Messenger/Tests/Middleware/SendMessageMiddlewareTest.php +++ b/src/Symfony/Component/Messenger/Tests/Middleware/SendMessageMiddlewareTest.php @@ -41,7 +41,7 @@ public function testItSendsTheMessageToAssignedSender() $envelope = $middleware->handle($envelope, $this->getStackMock(false)); - /* @var SentStamp $stamp */ + /** @var SentStamp $stamp */ $this->assertInstanceOf(SentStamp::class, $stamp = $envelope->last(SentStamp::class), 'it adds a sent stamp'); $this->assertSame('my_sender', $stamp->getSenderAlias()); $this->assertStringMatchesFormat('Mock_SenderInterface_%s', $stamp->getSenderClass()); diff --git a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php index 8789e38f89ecc..a0e5f9f7958d9 100644 --- a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php +++ b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php @@ -1368,7 +1368,7 @@ public function testNormalizerCanAccessOtherOptions() $this->resolver->setDefault('norm', 'baz'); $this->resolver->setNormalizer('norm', function (Options $options) { - /* @var TestCase $test */ + /** @var TestCase $test */ Assert::assertSame('bar', $options['default']); return 'normalized'; @@ -1386,7 +1386,7 @@ public function testNormalizerCanAccessLazyOptions() $this->resolver->setDefault('norm', 'baz'); $this->resolver->setNormalizer('norm', function (Options $options) { - /* @var TestCase $test */ + /** @var TestCase $test */ Assert::assertEquals('bar', $options['lazy']); return 'normalized'; diff --git a/src/Symfony/Component/PropertyAccess/PropertyPath.php b/src/Symfony/Component/PropertyAccess/PropertyPath.php index e797ab77be07c..71b90fc465967 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPath.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPath.php @@ -72,7 +72,7 @@ public function __construct(self|string $propertyPath) { // Can be used as copy constructor if ($propertyPath instanceof self) { - /* @var PropertyPath $propertyPath */ + /** @var PropertyPath $propertyPath */ $this->elements = $propertyPath->elements; $this->length = $propertyPath->length; $this->isIndex = $propertyPath->isIndex; diff --git a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php index a5480e0369823..e1b42eec5c66f 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php @@ -73,7 +73,7 @@ public function __construct(?DocBlockFactoryInterface $docBlockFactory = null, ? public function getShortDescription(string $class, string $property, array $context = []): ?string { - /** @var $docBlock DocBlock */ + /** @var DocBlock $docBlock */ [$docBlock] = $this->getDocBlock($class, $property); if (!$docBlock) { return null; @@ -100,7 +100,7 @@ public function getShortDescription(string $class, string $property, array $cont public function getLongDescription(string $class, string $property, array $context = []): ?string { - /** @var $docBlock DocBlock */ + /** @var DocBlock $docBlock */ [$docBlock] = $this->getDocBlock($class, $property); if (!$docBlock) { return null; @@ -113,7 +113,7 @@ public function getLongDescription(string $class, string $property, array $conte public function getTypes(string $class, string $property, array $context = []): ?array { - /** @var $docBlock DocBlock */ + /** @var DocBlock $docBlock */ [$docBlock, $source, $prefix] = $this->getDocBlock($class, $property); if (!$docBlock) { return null; diff --git a/src/Symfony/Component/Translation/Bridge/Crowdin/CrowdinProvider.php b/src/Symfony/Component/Translation/Bridge/Crowdin/CrowdinProvider.php index 2bfe1704932b1..a9fd436dcc53a 100644 --- a/src/Symfony/Component/Translation/Bridge/Crowdin/CrowdinProvider.php +++ b/src/Symfony/Component/Translation/Bridge/Crowdin/CrowdinProvider.php @@ -131,7 +131,7 @@ public function read(array $domains, array $locales): TranslatorBag } } - /* @var ResponseInterface $response */ + /** @var ResponseInterface $response */ $downloads = []; foreach ($responses as [$response, $locale, $domain]) { if (204 === $response->getStatusCode()) { diff --git a/src/Symfony/Component/Validator/Constraints/Composite.php b/src/Symfony/Component/Validator/Constraints/Composite.php index 7d50bd727715c..824c3a17430d2 100644 --- a/src/Symfony/Component/Validator/Constraints/Composite.php +++ b/src/Symfony/Component/Validator/Constraints/Composite.php @@ -55,7 +55,7 @@ public function __construct(mixed $options = null, ?array $groups = null, mixed $this->initializeNestedConstraints(); - /* @var Constraint[] $nestedConstraints */ + /** @var Constraint[] $nestedConstraints */ $compositeOption = $this->getCompositeOption(); $nestedConstraints = $this->$compositeOption; @@ -137,7 +137,7 @@ abstract protected function getCompositeOption(): string; */ public function getNestedConstraints(): array { - /* @var Constraint[] $nestedConstraints */ + /** @var Constraint[] $nestedConstraints */ return $this->{$this->getCompositeOption()}; } diff --git a/src/Symfony/Component/Validator/Tests/Validator/RecursiveValidatorTest.php b/src/Symfony/Component/Validator/Tests/Validator/RecursiveValidatorTest.php index cffbaa5fbeca5..e02023ab99b9f 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/RecursiveValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/RecursiveValidatorTest.php @@ -120,7 +120,7 @@ public function testValidate() $violations = $this->validate('Bernhard', $constraint, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -156,7 +156,7 @@ public function testClassConstraint() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -195,7 +195,7 @@ public function testPropertyConstraint() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -234,7 +234,7 @@ public function testGetterConstraint() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -271,7 +271,7 @@ public function testArray() $violations = $this->validate($array, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -308,7 +308,7 @@ public function testRecursiveArray() $violations = $this->validate($array, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -345,7 +345,7 @@ public function testTraversable() $violations = $this->validate($traversable, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -384,7 +384,7 @@ public function testRecursiveTraversable() $violations = $this->validate($traversable, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -422,7 +422,7 @@ public function testReferenceClassConstraint() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -463,7 +463,7 @@ public function testReferencePropertyConstraint() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -504,7 +504,7 @@ public function testReferenceGetterConstraint() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -525,7 +525,7 @@ public function testsIgnoreNullReference() $violations = $this->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -569,7 +569,7 @@ public function testArrayReference($constraintMethod) $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -610,7 +610,7 @@ public function testRecursiveArrayReference($constraintMethod) $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -642,7 +642,7 @@ public function testOnlyCascadedArraysAreTraversed() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -665,7 +665,7 @@ public function testArrayTraversalCannotBeDisabled($constraintMethod) $violations = $this->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); } @@ -689,7 +689,7 @@ public function testRecursiveArrayTraversalCannotBeDisabled($constraintMethod) $violations = $this->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); } @@ -705,7 +705,7 @@ public function testIgnoreScalarsDuringArrayTraversal($constraintMethod) $violations = $this->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -721,7 +721,7 @@ public function testIgnoreNullDuringArrayTraversal($constraintMethod) $violations = $this->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -751,7 +751,7 @@ public function testTraversableReference() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -780,7 +780,7 @@ public function testDisableTraversableTraversal() $violations = $this->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -827,7 +827,7 @@ public function testEnableRecursiveTraversableTraversal() $violations = $this->validate($entity, null, 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -875,7 +875,7 @@ public function testValidateProperty() $violations = $this->validateProperty($entity, 'firstName', 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -938,7 +938,7 @@ public function testValidatePropertyValue() 'Group' ); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -987,7 +987,7 @@ public function testValidatePropertyValueWithClassName() 'Group' ); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -1026,7 +1026,7 @@ public function testValidateObjectOnlyOncePerGroup() $violations = $this->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); } @@ -1046,7 +1046,7 @@ public function testValidateDifferentObjectsSeparately() $violations = $this->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(2, $violations); } @@ -1069,7 +1069,7 @@ public function testValidateSingleGroup() $violations = $this->validate($entity, null, 'Group 2'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); } @@ -1092,7 +1092,7 @@ public function testValidateMultipleGroups() $violations = $this->validate($entity, null, ['Group 1', 'Group 2']); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(2, $violations); } @@ -1125,7 +1125,7 @@ public function testReplaceDefaultGroupByGroupSequenceObject() $violations = $this->validate($entity, null, 'Default'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Violation in Group 2', $violations[0]->getMessage()); } @@ -1159,7 +1159,7 @@ public function testReplaceDefaultGroupByGroupSequenceArray() $violations = $this->validate($entity, null, 'Default'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Violation in Group 2', $violations[0]->getMessage()); } @@ -1191,7 +1191,7 @@ public function testPropagateDefaultGroupToReferenceWhenReplacingDefaultGroup() $violations = $this->validate($entity, null, 'Default'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Violation in Default group', $violations[0]->getMessage()); } @@ -1221,7 +1221,7 @@ public function testValidateCustomGroupWhenDefaultGroupWasReplaced() $violations = $this->validate($entity, null, 'Other Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Violation in other group', $violations[0]->getMessage()); } @@ -1259,7 +1259,7 @@ public function testReplaceDefaultGroup($sequence, array $assertViolations) $violations = $this->validate($entity, null, 'Default'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(\count($assertViolations), $violations); foreach ($assertViolations as $key => $message) { $this->assertSame($message, $violations[$key]->getMessage()); @@ -1362,7 +1362,7 @@ public function testGroupSequenceAbortsAfterFailedGroup() $sequence = new GroupSequence(['Group 1', 'Group 2', 'Group 3']); $violations = $this->validator->validate($entity, new Valid(), $sequence); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message 1', $violations[0]->getMessage()); } @@ -1392,7 +1392,7 @@ public function testGroupSequenceIncludesReferences() $sequence = new GroupSequence(['Group 1', 'Entity']); $violations = $this->validator->validate($entity, new Valid(), $sequence); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Reference violation 1', $violations[0]->getMessage()); } @@ -1410,7 +1410,7 @@ public function testValidateInSeparateContext() ->validate($value->reference, new Valid(), 'Group') ; - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -1451,7 +1451,7 @@ public function testValidateInSeparateContext() $violations = $this->validator->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Separate violation', $violations[0]->getMessage()); } @@ -1507,7 +1507,7 @@ public function testValidateInContext() $violations = $this->validator->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -1570,7 +1570,7 @@ public function testValidateArrayInContext() $violations = $this->validator->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -1608,7 +1608,7 @@ public function testTraverseTraversableByDefault() $violations = $this->validate($traversable, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -1640,7 +1640,7 @@ public function testTraversalEnabledOnClass() $violations = $this->validate($traversable, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); } @@ -1664,7 +1664,7 @@ public function testTraversalDisabledOnClass() $violations = $this->validate($traversable, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -1699,7 +1699,7 @@ public function testReferenceTraversalDisabledOnClass() $violations = $this->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -1726,7 +1726,7 @@ public function testReferenceTraversalEnabledOnReferenceDisabledOnClass() $violations = $this->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -1753,7 +1753,7 @@ public function testReferenceTraversalDisabledOnReferenceEnabledOnClass() $violations = $this->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -1773,7 +1773,7 @@ public function testReferenceCascadeDisabledByDefault() $violations = $this->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -1795,7 +1795,7 @@ public function testReferenceCascadeEnabledIgnoresUntyped() $violations = $this->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(0, $violations); } @@ -1825,7 +1825,7 @@ public function testTypedReferenceCascadeEnabled() $violations = $this->validate($entity, new Valid(), 'Group'); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertInstanceOf(Callback::class, $violations->get(0)->getConstraint()); } @@ -1847,7 +1847,7 @@ public function testAddCustomizedViolation() $violations = $this->validator->validate($entity); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); $this->assertSame('Message value', $violations[0]->getMessage()); $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); @@ -1874,7 +1874,7 @@ public function testNoDuplicateValidationIfClassConstraintInMultipleGroups() $violations = $this->validator->validate($entity, new Valid(), ['Group 1', 'Group 2']); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); } @@ -1893,7 +1893,7 @@ public function testNoDuplicateValidationIfPropertyConstraintInMultipleGroups() $violations = $this->validator->validate($entity, new Valid(), ['Group 1', 'Group 2']); - /* @var ConstraintViolationInterface[] $violations */ + /** @var ConstraintViolationInterface[] $violations */ $this->assertCount(1, $violations); } diff --git a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php index 2df310fb0a5b2..93c6700f1d983 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php @@ -448,7 +448,7 @@ private function validateClassNode(object $object, ?string $cacheKey, ClassMetad } else { // The group sequence is dynamically obtained from the validated // object - /* @var \Symfony\Component\Validator\GroupSequenceProviderInterface $object */ + /** @var \Symfony\Component\Validator\GroupSequenceProviderInterface $object */ $group = $object->getGroupSequence(); } $defaultOverridden = true; diff --git a/src/Symfony/Contracts/Service/ServiceSubscriberTrait.php b/src/Symfony/Contracts/Service/ServiceSubscriberTrait.php index c3c12ce3a278a..93d0d5fc7acaf 100644 --- a/src/Symfony/Contracts/Service/ServiceSubscriberTrait.php +++ b/src/Symfony/Contracts/Service/ServiceSubscriberTrait.php @@ -47,7 +47,7 @@ public static function getSubscribedServices(): array throw new \LogicException(\sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); } - /* @var SubscribedService $attribute */ + /** @var SubscribedService $attribute */ $attribute = $attribute->newInstance(); $attribute->key ??= self::class.'::'.$method->name; $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType;