Skip to content

Commit 657b867

Browse files
committed
[rector] Rector fixes
1 parent b7c7552 commit 657b867

21 files changed

Lines changed: 112 additions & 214 deletions

rules/CodeQuality/AttributeTransformer/ClassAttributeTransformer/EntityClassAttributeTransformer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414

1515
final class EntityClassAttributeTransformer implements ClassAttributeTransformerInterface
1616
{
17-
/**
18-
* @var string
19-
*/
20-
private const REPOSITORY_CLASS_KEY = 'repositoryClass';
17+
private const string REPOSITORY_CLASS_KEY = 'repositoryClass';
2118

2219
public function transform(EntityMapping $entityMapping, Class_ $class): bool
2320
{

rules/CodeQuality/AttributeTransformer/ClassAttributeTransformer/TableClassAttributeTransformer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414

1515
final readonly class TableClassAttributeTransformer implements ClassAttributeTransformerInterface
1616
{
17-
/**
18-
* @var string
19-
*/
20-
private const TABLE_KEY = 'table';
17+
private const string TABLE_KEY = 'table';
2118

2219
public function __construct(
2320
private NodeFactory $nodeFactory

rules/CodeQuality/AttributeTransformer/PropertyAttributeTransformer/IdGeneratorAttributeTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @see https://www.doctrine-project.org/projects/doctrine-orm/en/3.0/reference/basic-mapping.html#identifier-generation-strategies
2020
* @var string[]
2121
*/
22-
private const AVAILABLE_STRATEGIES = ['auto', 'sequence', 'identity', 'none', 'custom'];
22+
private const array AVAILABLE_STRATEGIES = ['auto', 'sequence', 'identity', 'none', 'custom'];
2323

2424
public function __construct(
2525
// private ArrayItemNodeFactory $arrayItemNodeFactory

rules/CodeQuality/Enum/CollectionMapping.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class CollectionMapping
1212
/**
1313
* @var string[]
1414
*/
15-
public const TO_MANY_CLASSES = [
15+
public const array TO_MANY_CLASSES = [
1616
MappingClass::ONE_TO_MANY,
1717
MappingClass::MANY_TO_MANY,
1818
OdmMappingClass::REFERENCE_MANY,
@@ -22,7 +22,7 @@ final class CollectionMapping
2222
/**
2323
* @var string[]
2424
*/
25-
public const TO_ONE_CLASSES = [
25+
public const array TO_ONE_CLASSES = [
2626
MappingClass::MANY_TO_ONE,
2727
MappingClass::ONE_TO_ONE,
2828
OdmMappingClass::REFERENCE_ONE,

rules/CodeQuality/Enum/DoctrineClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
/**
1414
* @deprecated BC only
1515
*/
16-
public const COLLECTION = \Rector\Doctrine\Enum\DoctrineClass::COLLECTION;
16+
public const string COLLECTION = \Rector\Doctrine\Enum\DoctrineClass::COLLECTION;
1717
}

rules/CodeQuality/Enum/DocumentMappingKey.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@
99
*/
1010
final class DocumentMappingKey
1111
{
12-
/**
13-
* @var string
14-
*/
15-
public const TARGET_DOCUMENT = 'targetDocument';
12+
public const string TARGET_DOCUMENT = 'targetDocument';
1613
}

rules/CodeQuality/Enum/EntityMappingKey.php

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,19 @@
99
*/
1010
final class EntityMappingKey
1111
{
12-
/**
13-
* @var string
14-
*/
15-
public const NULLABLE = 'nullable';
16-
17-
/**
18-
* @var string
19-
*/
20-
public const COLUMN_PREFIX = 'columnPrefix';
21-
22-
/**
23-
* @var string
24-
*/
25-
public const COLUMN = 'column';
26-
27-
/**
28-
* @var string
29-
*/
30-
public const STRATEGY = 'strategy';
31-
32-
/**
33-
* @var string
34-
*/
35-
public const GENERATOR = 'generator';
36-
37-
/**
38-
* @var string
39-
*/
40-
public const ORDER_BY = 'orderBy';
41-
42-
/**
43-
* @var string
44-
*/
45-
public const NAME = 'name';
46-
47-
/**
48-
* @var string
49-
*/
50-
public const TARGET_ENTITY = 'targetEntity';
12+
public const string NULLABLE = 'nullable';
13+
14+
public const string COLUMN_PREFIX = 'columnPrefix';
15+
16+
public const string COLUMN = 'column';
17+
18+
public const string STRATEGY = 'strategy';
19+
20+
public const string GENERATOR = 'generator';
21+
22+
public const string ORDER_BY = 'orderBy';
23+
24+
public const string NAME = 'name';
25+
26+
public const string TARGET_ENTITY = 'targetEntity';
5127
}

rules/CodeQuality/Rector/Class_/GetRepositoryServiceLocatorToRepositoryServiceInjectionRector.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
*/
3333
final class GetRepositoryServiceLocatorToRepositoryServiceInjectionRector extends AbstractRector
3434
{
35-
/**
36-
* @var string
37-
*/
38-
private const GET_REPOSITORY_METHOD = 'getRepository';
35+
private const string GET_REPOSITORY_METHOD = 'getRepository';
3936

4037
public function __construct(
4138
private readonly ValueResolver $valueResolver,

rules/CodeQuality/Rector/Property/TypedPropertyFromToOneRelationTypeRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
final class TypedPropertyFromToOneRelationTypeRector extends AbstractRector implements MinPhpVersionInterface, ConfigurableRectorInterface
3535
{
36-
public const FORCE_NULLABLE = 'force_nullable';
36+
public const string FORCE_NULLABLE = 'force_nullable';
3737

3838
private bool $forceNullable = true;
3939

rules/Dbal36/Rector/MethodCall/MigrateQueryBuilderResetQueryPartRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class MigrateQueryBuilderResetQueryPartRector extends AbstractRector
2424
/**
2525
* @var array<string, string>
2626
*/
27-
private const PART_TO_METHOD_MAP = [
27+
private const array PART_TO_METHOD_MAP = [
2828
'where' => 'resetWhere',
2929
'groupBy' => 'resetGroupBy',
3030
'having' => 'resetHaving',

0 commit comments

Comments
 (0)