Skip to content

Commit ee91783

Browse files
committed
Update Rector config
1 parent 614a540 commit ee91783

File tree

16 files changed

+28
-55
lines changed

16 files changed

+28
-55
lines changed

rector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
])
2222
->withPhpVersion(PhpVersion::PHP_74)
2323
->withPhpSets()
24+
->withConfiguredRule(TypedPropertyFromAssignsRector::class, [])
2425
->withSkip([
2526
TypedPropertyFromAssignsRector::class => [
2627
__DIR__.'/src/Mapping/MappedEventSubscriber.php', // Rector is trying to set a type on the $annotationReader property which requires a union type, not supported on PHP 7.4
27-
__DIR__.'/tests/Gedmo/Wrapper/Fixture/Entity/CompositeRelation.php', // @todo: remove this when https://github.com/doctrine/orm/issues/8255 is solved
28+
__DIR__.'/tests/Gedmo/Blameable/Fixture/Entity/Company.php', // @todo: Remove this when fixing the configuration for the `Company::$created` property
29+
__DIR__.'/tests/Gedmo/Wrapper/Fixture/Entity/CompositeRelation.php', // @todo: Remove this when https://github.com/doctrine/orm/issues/8255 is solved
2830
],
2931
])
3032
->withImportNames(true, true, false)

src/Sluggable/SluggableListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ class SluggableListener extends MappedEventSubscriber
7474
/**
7575
* The power exponent to jump
7676
* the slug unique number by tens.
77-
*
78-
* @var int
7977
*/
80-
private $exponent = 0;
78+
private int $exponent = 0;
8179

8280
/**
8381
* Transliteration callback for slugs

src/SoftDeleteable/Query/TreeWalker/SoftDeleteableWalker.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ class SoftDeleteableWalker extends SqlWalker
8181
*/
8282
protected $meta;
8383

84-
/**
85-
* @var QuoteStrategy
86-
*/
87-
private $quoteStrategy;
84+
private QuoteStrategy $quoteStrategy;
8885

8986
public function __construct($query, $parserResult, array $queryComponents)
9087
{

src/Tool/Logging/DBAL/QueryAnalyzer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ class QueryAnalyzer implements SQLLogger
4646
*
4747
* @var string[]
4848
*/
49-
private $queries = [];
49+
private array $queries = [];
5050

5151
/**
5252
* Query execution times indexed
5353
* in same order as queries
5454
*
5555
* @var float[]
5656
*/
57-
private $queryExecutionTimes = [];
57+
private array $queryExecutionTimes = [];
5858

5959
/**
6060
* Initialize log listener with database

src/Translatable/Query/TreeWalker/TranslationWalker.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ class TranslationWalker extends SqlWalker
9797

9898
/**
9999
* DBAL database connection
100-
*
101-
* @var Connection
102100
*/
103-
private $conn;
101+
private Connection $conn;
104102

105103
/**
106104
* List of aliases to replace with translation

src/Tree/Strategy/ORM/Closure.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Closure implements Strategy
6464
*
6565
* @phpstan-var array<int, array{node: object|Node, oldParent: mixed}>
6666
*/
67-
private $pendingNodeUpdates = [];
67+
private array $pendingNodeUpdates = [];
6868

6969
/**
7070
* List of pending Nodes, which needs their "level"

src/Tree/Strategy/ORM/Nested.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class Nested implements Strategy
7575
*
7676
* @var array<string, int>
7777
*/
78-
private $treeEdges = [];
78+
private array $treeEdges = [];
7979

8080
/**
8181
* Stores a list of node position strategies

src/Uploadable/UploadableListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class UploadableListener extends MappedEventSubscriber
7676
*
7777
* @var array<int, string>
7878
*/
79-
private $pendingFileRemovals = [];
79+
private array $pendingFileRemovals = [];
8080

8181
/**
8282
* Array of FileInfoInterface objects. The index is the hash of the entity owner
@@ -86,7 +86,7 @@ class UploadableListener extends MappedEventSubscriber
8686
*
8787
* @phpstan-var array<int, array{entity: object, fileInfo: FileInfoInterface}>
8888
*/
89-
private $fileInfoObjects = [];
89+
private array $fileInfoObjects = [];
9090

9191
public function __construct(?MimeTypeGuesserInterface $mimeTypeGuesser = null)
9292
{

tests/Gedmo/Blameable/Fixture/Entity/Company.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ class Company implements Blameable
3737
private $id;
3838

3939
/**
40-
* @var string|null
41-
*
4240
* @ORM\Column(name="name", type="string", length=128)
4341
*/
4442
#[ORM\Column(name: 'name', type: Types::STRING, length: 128)]
45-
private $name;
43+
private ?string $name = null;
4644

4745
/**
48-
* @var UuidV6|null
46+
* @var UuidV6|string|null
4947
*
5048
* @Gedmo\Blameable(on="create")
5149
*

tests/Gedmo/Sluggable/Fixture/Issue100/Article.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,15 @@ class Article implements Sluggable, Translatable
3636
private $id;
3737

3838
/**
39-
* @var string|null
40-
*
4139
* @Gedmo\Translatable
4240
*
4341
* @ORM\Column(name="title", type="string", length=64)
4442
*/
4543
#[ORM\Column(name: 'title', type: Types::STRING, length: 64)]
4644
#[Gedmo\Translatable]
47-
private $title;
45+
private ?string $title = null;
4846

4947
/**
50-
* @var string|null
51-
*
5248
* @Gedmo\Translatable
5349
* @Gedmo\Slug(separator="-", updatable=true, fields={"title"}, unique=true, uniqueOverTranslations=true)
5450
*
@@ -57,17 +53,15 @@ class Article implements Sluggable, Translatable
5753
#[Gedmo\Translatable]
5854
#[Gedmo\Slug(fields: ['title'], updatable: true, unique: true, uniqueOverTranslations: true, separator: '-')]
5955
#[ORM\Column(name: 'slug', type: Types::STRING, length: 64, unique: true)]
60-
private $slug;
56+
private ?string $slug = null;
6157

6258
/**
63-
* @var string|null
64-
*
6559
* @Gedmo\Locale
6660
* Used locale to override Translation listener`s locale
6761
* this is not a mapped field of entity metadata, just a simple property
6862
*/
6963
#[Gedmo\Locale]
70-
private $locale;
64+
private ?string $locale = null;
7165

7266
public function getId(): ?int
7367
{

0 commit comments

Comments
 (0)