Merge pull request #493 from greg0ire/rector-tests

Use Rector on tests
This commit is contained in:
Grégoire Paris
2026-01-24 21:57:29 +01:00
committed by GitHub
4 changed files with 9 additions and 7 deletions

View File

@@ -134,8 +134,8 @@ class TestAbstractClassMetadataFactory extends AbstractClassMetadataFactory
/** @param ClassMetadata<object>|null $defaultMetadata */
public function __construct(
private MappingDriver|null $driver = null,
private ClassMetadata|null $defaultMetadata = null,
private readonly MappingDriver|null $driver = null,
private readonly ClassMetadata|null $defaultMetadata = null,
) {
}

View File

@@ -21,9 +21,11 @@ class RuntimeReflectionServiceTest extends TestCase
public mixed $unusedPublicProperty;
private string $typedNoDefaultProperty;
/** @phpstan-ignore property.uninitializedReadonly */
private readonly string $typedNoDefaultProperty;
private string $typedDefaultProperty = '';
private string $nonTypedNoDefaultProperty; // phpcs:ignore SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty
/** @phpstan-ignore property.uninitializedReadonly */
private readonly string $nonTypedNoDefaultProperty; // phpcs:ignore SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty
private string $nonTypedDefaultProperty = ''; // phpcs:ignore SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty
public string $typedNoDefaultPublicProperty;

View File

@@ -72,7 +72,7 @@ class TypedFoo
class TypedNullableFoo
{
private string|null $value;
private string|null $value = null;
public function setValue(mixed $value): void
{

View File

@@ -39,8 +39,8 @@ class RuntimeReflectionPropertyTest extends TestCase
}
/** @param class-string<RuntimeReflectionPropertyTestProxyMock> $proxyClass */
#[TestWith(['Doctrine\\Tests\\Persistence\\RuntimeReflectionPropertyTestProxyMock'])]
#[TestWith(['\\Doctrine\\Tests\\Persistence\\RuntimeReflectionPropertyTestProxyMock'])]
#[TestWith([RuntimeReflectionPropertyTestProxyMock::class])]
#[TestWith([RuntimeReflectionPropertyTestProxyMock::class])]
public function testGetValueOnProxyProperty(string $proxyClass): void
{
$getCheckMock = $this->createMock(DummyMock::class);