Skip to content

docs: remove unnecessary comments #6408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/JsonSchema/Command/JsonSchemaGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions src/JsonSchema/Tests/SchemaFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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']);
Expand Down Expand Up @@ -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']);
Expand Down Expand Up @@ -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']);
Expand Down
2 changes: 0 additions & 2 deletions src/JsonSchema/Tests/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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']
),
]),
Expand Down
1 change: 0 additions & 1 deletion src/Serializer/AbstractCollectionNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/Serializer/JsonEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
3 changes: 0 additions & 3 deletions tests/Behat/DoctrineContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/TestBundle/Entity/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 0 additions & 4 deletions tests/Hal/JsonSchema/SchemaFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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']);
Expand All @@ -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']);
Expand Down
8 changes: 0 additions & 8 deletions tests/Hydra/JsonSchema/SchemaFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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']);
Expand All @@ -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']);
Expand All @@ -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']);
Expand Down
4 changes: 0 additions & 4 deletions tests/JsonApi/JsonSchema/SchemaFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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']);
Expand Down Expand Up @@ -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']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
Expand Down
Loading