diff --git a/src/JsonSchema/Command/JsonSchemaGenerateCommand.php b/src/JsonSchema/Command/JsonSchemaGenerateCommand.php index 708c83d5fcb..ecd492db43a 100644 --- a/src/JsonSchema/Command/JsonSchemaGenerateCommand.php +++ b/src/JsonSchema/Command/JsonSchemaGenerateCommand.php @@ -31,7 +31,6 @@ */ final class JsonSchemaGenerateCommand extends Command { - // @noRector \Rector\Php81\Rector\Property\ReadOnlyPropertyRector private array $formats; public function __construct(private readonly SchemaFactoryInterface $schemaFactory, array $formats) diff --git a/src/JsonSchema/Tests/SchemaFactoryTest.php b/src/JsonSchema/Tests/SchemaFactoryTest.php index 0f66e915acc..bf3bd56ae46 100644 --- a/src/JsonSchema/Tests/SchemaFactoryTest.php +++ b/src/JsonSchema/Tests/SchemaFactoryTest.php @@ -91,7 +91,6 @@ public function testBuildSchemaForNonResourceClass(): void $definitions = $resultSchema->getDefinitions(); $this->assertSame((new \ReflectionClass(NotAResource::class))->getShortName(), $rootDefinitionKey); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey])); $this->assertArrayHasKey('type', $definitions[$rootDefinitionKey]); $this->assertSame('object', $definitions[$rootDefinitionKey]['type']); @@ -168,7 +167,6 @@ public function testBuildSchemaForNonResourceClassWithUnionIntersectTypes(): voi $definitions = $resultSchema->getDefinitions(); $this->assertSame((new \ReflectionClass(NotAResourceWithUnionIntersectTypes::class))->getShortName(), $rootDefinitionKey); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey])); $this->assertArrayHasKey('type', $definitions[$rootDefinitionKey]); $this->assertSame('object', $definitions[$rootDefinitionKey]['type']); @@ -252,7 +250,6 @@ public function testBuildSchemaWithSerializerGroups(): void $definitions = $resultSchema->getDefinitions(); $this->assertSame((new \ReflectionClass(OverriddenOperationDummy::class))->getShortName().'-'.$serializerGroup, $rootDefinitionKey); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey])); $this->assertArrayHasKey('type', $definitions[$rootDefinitionKey]); $this->assertSame('object', $definitions[$rootDefinitionKey]['type']); @@ -311,7 +308,6 @@ public function testBuildSchemaForAssociativeArray(): void $definitions = $resultSchema->getDefinitions(); $this->assertSame((new \ReflectionClass(NotAResource::class))->getShortName(), $rootDefinitionKey); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey])); $this->assertArrayHasKey('properties', $definitions[$rootDefinitionKey]); $this->assertArrayHasKey('foo', $definitions[$rootDefinitionKey]['properties']); diff --git a/src/JsonSchema/Tests/SchemaTest.php b/src/JsonSchema/Tests/SchemaTest.php index 554d3f204f2..73175d0995a 100644 --- a/src/JsonSchema/Tests/SchemaTest.php +++ b/src/JsonSchema/Tests/SchemaTest.php @@ -73,12 +73,10 @@ public function testDefinitions(string $version, array $baseDefinitions): void if (Schema::VERSION_OPENAPI === $version) { $this->assertArrayHasKey('schemas', $schema['components']); } else { - // @noRector $this->assertTrue(isset($schema['definitions'])); } $definitions = $schema->getDefinitions(); - // @noRector $this->assertTrue(isset($definitions['foo'])); $this->assertArrayNotHasKey('definitions', $schema->getArrayCopy(false)); diff --git a/src/Metadata/Tests/Resource/Factory/AttributesResourceMetadataCollectionFactoryTest.php b/src/Metadata/Tests/Resource/Factory/AttributesResourceMetadataCollectionFactoryTest.php index f3c457553d2..124def411ec 100644 --- a/src/Metadata/Tests/Resource/Factory/AttributesResourceMetadataCollectionFactoryTest.php +++ b/src/Metadata/Tests/Resource/Factory/AttributesResourceMetadataCollectionFactoryTest.php @@ -95,7 +95,6 @@ class: AttributeResource::class, priority: 4, status: 301, provider: AttributeResourceProvider::class, - // @noRector \Rector\Php81\Rector\Array_\FirstClassCallableRector processor: [AttributeResourceProcessor::class, 'process'] ), '_api_/dummy/{dummyId}/attribute_resources/{identifier}{._format}_patch' => new Patch( @@ -106,14 +105,12 @@ class: AttributeResource::class, priority: 5, status: 301, provider: AttributeResourceProvider::class, - // @noRector \Rector\Php81\Rector\Array_\FirstClassCallableRector processor: [AttributeResourceProcessor::class, 'process'] ), ], inputFormats: ['json' => ['application/merge-patch+json']], status: 301, provider: AttributeResourceProvider::class, - // @noRector \Rector\Php81\Rector\Array_\FirstClassCallableRector processor: [AttributeResourceProcessor::class, 'process'] ), ]), diff --git a/src/Serializer/AbstractCollectionNormalizer.php b/src/Serializer/AbstractCollectionNormalizer.php index ff1aa7f1a07..7275012fa40 100644 --- a/src/Serializer/AbstractCollectionNormalizer.php +++ b/src/Serializer/AbstractCollectionNormalizer.php @@ -40,7 +40,6 @@ abstract class AbstractCollectionNormalizer implements NormalizerInterface, Norm /** * This constant must be overridden in the child class. */ - // @noRector \Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector public const FORMAT = 'to-override'; public function __construct(protected ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver, protected string $pageParameterName, protected ?ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory = null) diff --git a/src/Serializer/JsonEncoder.php b/src/Serializer/JsonEncoder.php index 4b1be321528..f7a34ca4f18 100644 --- a/src/Serializer/JsonEncoder.php +++ b/src/Serializer/JsonEncoder.php @@ -26,7 +26,6 @@ */ final class JsonEncoder implements EncoderInterface, DecoderInterface { - // @noRector \Rector\Php81\Rector\Property\ReadOnlyPropertyRector public function __construct(private readonly string $format, private ?BaseJsonEncoder $jsonEncoder = null) { if (null !== $this->jsonEncoder) { diff --git a/src/Symfony/Bundle/DependencyInjection/Compiler/ElasticsearchClientPass.php b/src/Symfony/Bundle/DependencyInjection/Compiler/ElasticsearchClientPass.php index 7ca076677db..1be89c71010 100644 --- a/src/Symfony/Bundle/DependencyInjection/Compiler/ElasticsearchClientPass.php +++ b/src/Symfony/Bundle/DependencyInjection/Compiler/ElasticsearchClientPass.php @@ -57,10 +57,8 @@ public function process(ContainerBuilder $container): void $clientDefinition = $container->getDefinition('api_platform.elasticsearch.client'); if (!$clientConfiguration) { - // @noRector \Rector\Php81\Rector\Array_\FirstClassCallableRector $clientDefinition->setFactory([$builderName, 'build']); } else { - // @noRector \Rector\Php81\Rector\Array_\FirstClassCallableRector $clientDefinition->setFactory([$builderName, 'fromConfig']); $clientDefinition->setArguments([$clientConfiguration]); } diff --git a/tests/Behat/DoctrineContext.php b/tests/Behat/DoctrineContext.php index 90c9d183dcf..12bf54950c1 100644 --- a/tests/Behat/DoctrineContext.php +++ b/tests/Behat/DoctrineContext.php @@ -224,11 +224,8 @@ */ final class DoctrineContext implements Context { - // @noRector \Rector\Php81\Rector\Property\ReadOnlyPropertyRector private ObjectManager $manager; - // @noRector \Rector\Php81\Rector\Property\ReadOnlyPropertyRector private ?SchemaTool $schemaTool; - // @noRector \Rector\Php81\Rector\Property\ReadOnlyPropertyRector private ?SchemaManager $schemaManager; /** diff --git a/tests/Fixtures/TestBundle/Entity/Content.php b/tests/Fixtures/TestBundle/Entity/Content.php index 4b2142a8989..bc026cc16f5 100644 --- a/tests/Fixtures/TestBundle/Entity/Content.php +++ b/tests/Fixtures/TestBundle/Entity/Content.php @@ -37,7 +37,6 @@ class Content implements \JsonSerializable #[ORM\OrderBy(['id' => 'ASC'])] private Collection|iterable $fields; #[ORM\Column(type: 'string')] - // @noRector \Rector\Php81\Rector\Property\ReadOnlyPropertyRector private string $status = ContentStatus::DRAFT; public function __construct() diff --git a/tests/Hal/JsonSchema/SchemaFactoryTest.php b/tests/Hal/JsonSchema/SchemaFactoryTest.php index 99ad84e113a..b59ffef7f8b 100644 --- a/tests/Hal/JsonSchema/SchemaFactoryTest.php +++ b/tests/Hal/JsonSchema/SchemaFactoryTest.php @@ -87,9 +87,7 @@ public function testHasRootDefinitionKeyBuildSchema(): void $definitions = $resultSchema->getDefinitions(); $rootDefinitionKey = $resultSchema->getRootDefinitionKey(); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey])); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey]['properties'])); $properties = $resultSchema['definitions'][$rootDefinitionKey]['properties']; $this->assertArrayHasKey('_links', $properties); @@ -118,7 +116,6 @@ public function testSchemaTypeBuildSchema(): void $definitionName = 'Dummy.jsonhal'; $this->assertNull($resultSchema->getRootDefinitionKey()); - // @noRector $this->assertTrue(isset($resultSchema['properties'])); $this->assertArrayHasKey('_embedded', $resultSchema['properties']); $this->assertArrayHasKey('totalItems', $resultSchema['properties']); @@ -130,7 +127,6 @@ public function testSchemaTypeBuildSchema(): void $resultSchema = $this->schemaFactory->buildSchema(Dummy::class, 'jsonhal', Schema::TYPE_OUTPUT, null, null, null, true); $this->assertNull($resultSchema->getRootDefinitionKey()); - // @noRector $this->assertTrue(isset($resultSchema['properties'])); $this->assertArrayHasKey('_embedded', $resultSchema['properties']); $this->assertArrayHasKey('totalItems', $resultSchema['properties']); diff --git a/tests/Hydra/JsonSchema/SchemaFactoryTest.php b/tests/Hydra/JsonSchema/SchemaFactoryTest.php index b1a6029503d..58536fc69ea 100644 --- a/tests/Hydra/JsonSchema/SchemaFactoryTest.php +++ b/tests/Hydra/JsonSchema/SchemaFactoryTest.php @@ -86,9 +86,7 @@ public function testHasRootDefinitionKeyBuildSchema(): void $definitions = $resultSchema->getDefinitions(); $rootDefinitionKey = $resultSchema->getRootDefinitionKey(); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey])); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey]['properties'])); $properties = $resultSchema['definitions'][$rootDefinitionKey]['properties']; $this->assertArrayHasKey('@context', $properties); @@ -125,9 +123,7 @@ public function testSchemaTypeBuildSchema(): void $definitionName = 'Dummy.jsonld'; $this->assertNull($resultSchema->getRootDefinitionKey()); - // @noRector $this->assertTrue(isset($resultSchema['properties'])); - // @noRector $this->assertTrue(isset($resultSchema['properties']['hydra:member'])); $this->assertArrayHasKey('hydra:totalItems', $resultSchema['properties']); $this->assertArrayHasKey('hydra:view', $resultSchema['properties']); @@ -140,9 +136,7 @@ public function testSchemaTypeBuildSchema(): void $resultSchema = $this->schemaFactory->buildSchema(Dummy::class, 'jsonld', Schema::TYPE_OUTPUT, null, null, null, true); $this->assertNull($resultSchema->getRootDefinitionKey()); - // @noRector $this->assertTrue(isset($resultSchema['properties'])); - // @noRector $this->assertTrue(isset($resultSchema['properties']['hydra:member'])); $this->assertArrayHasKey('hydra:totalItems', $resultSchema['properties']); $this->assertArrayHasKey('hydra:view', $resultSchema['properties']); @@ -158,9 +152,7 @@ public function testHasHydraViewNavigationBuildSchema(): void $resultSchema = $this->schemaFactory->buildSchema(Dummy::class, 'jsonld', Schema::TYPE_OUTPUT, new GetCollection()); $this->assertNull($resultSchema->getRootDefinitionKey()); - // @noRector $this->assertTrue(isset($resultSchema['properties'])); - // @noRector $this->assertTrue(isset($resultSchema['properties']['hydra:view'])); $this->assertArrayHasKey('properties', $resultSchema['properties']['hydra:view']); $this->assertArrayHasKey('hydra:first', $resultSchema['properties']['hydra:view']['properties']); diff --git a/tests/JsonApi/JsonSchema/SchemaFactoryTest.php b/tests/JsonApi/JsonSchema/SchemaFactoryTest.php index 7c0d335e78a..fa049800147 100644 --- a/tests/JsonApi/JsonSchema/SchemaFactoryTest.php +++ b/tests/JsonApi/JsonSchema/SchemaFactoryTest.php @@ -98,9 +98,7 @@ public function testHasRootDefinitionKeyBuildSchema(): void $definitions = $resultSchema->getDefinitions(); $rootDefinitionKey = $resultSchema->getRootDefinitionKey(); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey])); - // @noRector $this->assertTrue(isset($definitions[$rootDefinitionKey]['properties'])); $properties = $resultSchema['definitions'][$rootDefinitionKey]['properties']; $this->assertArrayHasKey('data', $properties); @@ -135,7 +133,6 @@ public function testSchemaTypeBuildSchema(): void $definitionName = 'Dummy.jsonapi'; $this->assertNull($resultSchema->getRootDefinitionKey()); - // @noRector $this->assertTrue(isset($resultSchema['properties'])); $this->assertArrayHasKey('links', $resultSchema['properties']); $this->assertArrayHasKey('self', $resultSchema['properties']['links']['properties']); @@ -163,7 +160,6 @@ public function testSchemaTypeBuildSchema(): void $resultSchema = $this->schemaFactory->buildSchema(Dummy::class, 'jsonapi', Schema::TYPE_OUTPUT, forceCollection: true); $this->assertNull($resultSchema->getRootDefinitionKey()); - // @noRector $this->assertTrue(isset($resultSchema['properties'])); $this->assertArrayHasKey('links', $resultSchema['properties']); $this->assertArrayHasKey('self', $resultSchema['properties']['links']['properties']); diff --git a/tests/Symfony/Bundle/DependencyInjection/Compiler/ElasticsearchClientPassTest.php b/tests/Symfony/Bundle/DependencyInjection/Compiler/ElasticsearchClientPassTest.php index 3cb5f70410a..2245b50df0c 100644 --- a/tests/Symfony/Bundle/DependencyInjection/Compiler/ElasticsearchClientPassTest.php +++ b/tests/Symfony/Bundle/DependencyInjection/Compiler/ElasticsearchClientPassTest.php @@ -56,7 +56,6 @@ public function testProcess(): void } $clientDefinitionProphecy = $this->prophesize(Definition::class); - // @noRector \Rector\Php81\Rector\Array_\FirstClassCallableRector $clientDefinitionProphecy->setFactory([$clientBuilder, 'fromConfig'])->willReturn($clientDefinitionProphecy->reveal())->shouldBeCalled(); $clientDefinitionProphecy->setArguments( Argument::allOf( @@ -79,7 +78,6 @@ public function testProcessWithoutConfiguration(): void $clientBuilder = class_exists(\Elasticsearch\ClientBuilder::class) ? \Elasticsearch\ClientBuilder::class : \Elastic\Elasticsearch\ClientBuilder::class; $clientDefinitionProphecy = $this->prophesize(Definition::class); - // @noRector \Rector\Php81\Rector\Array_\FirstClassCallableRector $clientDefinitionProphecy->setFactory([$clientBuilder, 'build'])->willReturn($clientDefinitionProphecy->reveal())->shouldBeCalled(); $containerBuilderProphecy = $this->prophesize(ContainerBuilder::class);