Skip to content

Commit 2f5c03b

Browse files
authored
Apply phpdoc_to_property_type (#944)
1 parent da36091 commit 2f5c03b

22 files changed

+44
-90
lines changed

.dev-tools/src/Fixer/OrderedClassElementsInternalFixer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ final class OrderedClassElementsInternalFixer implements FixerInterface
3838
'getSuccessorsNames',
3939
];
4040

41-
/** @var OrderedClassElementsFixerWrapper */
42-
private $orderedClassElementsFixerWrapper;
41+
private OrderedClassElementsFixerWrapper $orderedClassElementsFixerWrapper;
4342

4443
public function __construct()
4544
{

.dev-tools/src/OrderedClassElementsFixerWrapper.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,10 @@
1919
*/
2020
final class OrderedClassElementsFixerWrapper
2121
{
22-
/** @var OrderedClassElementsFixer */
23-
private $orderedClassElementsFixer;
24-
25-
/** @var \ReflectionMethod */
26-
private $getElements;
27-
28-
/** @var \ReflectionMethod */
29-
private $sortElements;
30-
31-
/** @var \ReflectionMethod */
32-
private $sortTokens;
22+
private OrderedClassElementsFixer $orderedClassElementsFixer;
23+
private \ReflectionMethod $getElements;
24+
private \ReflectionMethod $sortElements;
25+
private \ReflectionMethod $sortTokens;
3326

3427
public function __construct()
3528
{

.dev-tools/src/Priority/PriorityCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
final class PriorityCollection
2323
{
2424
/** @var list<PriorityFixer> */
25-
private $priorityFixers = [];
25+
private array $priorityFixers = [];
2626

2727
public static function create(): self
2828
{

.dev-tools/src/Priority/PriorityFixer.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@
1515

1616
final class PriorityFixer
1717
{
18-
/** @var FixerInterface */
19-
private $fixer;
18+
private FixerInterface $fixer;
2019

2120
/** @var list<self> */
22-
private $fixersToRunAfter = [];
21+
private array $fixersToRunAfter = [];
2322

2423
/** @var list<self> */
25-
private $fixersToRunBefore = [];
24+
private array $fixersToRunBefore = [];
2625

27-
/** @var null|int */
28-
private $priority;
26+
private ?int $priority;
2927

3028
public function __construct(FixerInterface $fixer, ?int $priority)
3129
{

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
- os: windows-latest
7070
description: 'on Windows'
7171
php-version: '8.3'
72+
FAST_LINT_TEST_CASES: 1
7273
- os: ubuntu-latest
7374
php-version: '8.4'
7475
runs-on: ${{ matrix.os }}
@@ -115,6 +116,8 @@ jobs:
115116
- run: composer show | grep php-cs-fixer
116117

117118
- run: ./vendor/bin/phpunit ${{ matrix.phpunit-flags }}
119+
env:
120+
FAST_LINT_TEST_CASES: ${{ matrix.FAST_LINT_TEST_CASES }}
118121

119122
- if: ${{ matrix.calculate-coverage }}
120123
env:

.php-cs-fixer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
}
2828

2929
unset($rules['class_keyword']); // temporary
30-
unset($rules['phpdoc_to_property_type']); // temporary
3130

3231
// PhpCsFixerCustomFixersDev\Fixer\OrderedClassElementsInternalFixer will handle this
3332
unset($rules['ordered_class_elements']);

src/Analyzer/Analysis/ArgumentAnalysis.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@
1616
*/
1717
final class ArgumentAnalysis
1818
{
19-
/** @var int */
20-
private $startIndex;
21-
22-
/** @var int */
23-
private $endIndex;
24-
25-
/** @var bool */
26-
private $isConstant;
19+
private int $startIndex;
20+
private int $endIndex;
21+
private bool $isConstant;
2722

2823
public function __construct(int $startIndex, int $endIndex, bool $isConstant)
2924
{

src/Analyzer/Analysis/ArrayElementAnalysis.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,10 @@
1616
*/
1717
final class ArrayElementAnalysis
1818
{
19-
/** @var ?int */
20-
private $keyStartIndex;
21-
22-
/** @var ?int */
23-
private $keyEndIndex;
24-
25-
/** @var int */
26-
private $valueStartIndex;
27-
28-
/** @var int */
29-
private $valueEndIndex;
19+
private ?int $keyStartIndex;
20+
private ?int $keyEndIndex;
21+
private int $valueStartIndex;
22+
private int $valueEndIndex;
3023

3124
public function __construct(?int $keyStartIndex, ?int $keyEndIndex, int $valueStartIndex, int $valueEndIndex)
3225
{

src/Analyzer/Analysis/CaseAnalysis.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
*/
1717
final class CaseAnalysis
1818
{
19-
/** @var int */
20-
private $colonIndex;
19+
private int $colonIndex;
2120

2221
public function __construct(int $colonIndex)
2322
{

src/Analyzer/Analysis/ConstructorAnalysis.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
*/
2020
final class ConstructorAnalysis
2121
{
22-
/** @var Tokens */
23-
private $tokens;
24-
25-
/** @var int */
26-
private $constructorIndex;
22+
private Tokens $tokens;
23+
private int $constructorIndex;
2724

2825
public function __construct(Tokens $tokens, int $constructorIndex)
2926
{

0 commit comments

Comments
 (0)