Skip to content

Commit aa7d891

Browse files
authored
Merge pull request #260 from andreaswolf/rector-2
[TASK] Use Rector 2.0
2 parents a36555a + 118a657 commit aa7d891

File tree

90 files changed

+135
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+135
-117
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"league/flysystem-memory": "^2.0 || ^3.0",
2222
"nette/utils": "^4.0",
2323
"ondram/ci-detector": "^4.2",
24-
"phpstan/phpstan": "^1.10.9",
24+
"phpstan/phpstan": "^2.0.0",
2525
"sebastian/diff": "^4.0 || ^5.0 || ^6.0",
2626
"simonschaufi/pretty-xml": "^3.0.0",
2727
"symfony/config": "^5.4 || ^6.4 || ^7.0",
@@ -36,9 +36,9 @@
3636
"require-dev": {
3737
"composer/composer": "^2.7",
3838
"ergebnis/composer-normalize": "^2.42",
39-
"phpstan/phpstan-phpunit": "^1.3",
39+
"phpstan/phpstan-phpunit": "^2.0.0",
4040
"phpunit/phpunit": "^10.5",
41-
"rector/rector": "^1.2.6",
41+
"rector/rector": "^2.0.0",
4242
"symplify/easy-coding-standard": "^12.3",
4343
"symplify/monorepo-builder": "^11.2",
4444
"symplify/rule-doc-generator": "12.1.3"

packages/fractor-composer-json/rules-tests/AddPackageToRequireComposerJsonFractor/AddPackageToRequireComposerJsonFractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function provideData(): Iterator
2323
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.json.fixture');
2424
}
2525

26-
public function provideConfigFilePath(): ?string
26+
public function provideConfigFilePath(): string
2727
{
2828
return __DIR__ . '/config/fractor.php';
2929
}

packages/fractor-composer-json/rules-tests/AddPackageToRequireDevComposerJsonFractor/AddPackageToRequireDevComposerJsonFractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function provideData(): Iterator
2323
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.json.fixture');
2424
}
2525

26-
public function provideConfigFilePath(): ?string
26+
public function provideConfigFilePath(): string
2727
{
2828
return __DIR__ . '/config/fractor.php';
2929
}

packages/fractor-composer-json/rules-tests/ChangePackageVersionComposerJsonFractor/ChangePackageVersionComposerJsonFractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function provideData(): Iterator
2323
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.json.fixture');
2424
}
2525

26-
public function provideConfigFilePath(): ?string
26+
public function provideConfigFilePath(): string
2727
{
2828
return __DIR__ . '/config/fractor.php';
2929
}

packages/fractor-composer-json/rules-tests/RemovePackageComposerJsonFractor/RemovePackageComposerJsonFractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function provideData(): Iterator
2323
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.json.fixture');
2424
}
2525

26-
public function provideConfigFilePath(): ?string
26+
public function provideConfigFilePath(): string
2727
{
2828
return __DIR__ . '/config/fractor.php';
2929
}

packages/fractor-composer-json/rules-tests/RenamePackageComposerJsonFractor/RenamePackageComposerJsonFractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function provideData(): Iterator
2323
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.json.fixture');
2424
}
2525

26-
public function provideConfigFilePath(): ?string
26+
public function provideConfigFilePath(): string
2727
{
2828
return __DIR__ . '/config/fractor.php';
2929
}

packages/fractor-composer-json/rules-tests/ReplacePackageAndVersionComposerJsonFractor/ReplacePackageAndVersionComposerJsonFractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function provideData(): Iterator
2323
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.json.fixture');
2424
}
2525

26-
public function provideConfigFilePath(): ?string
26+
public function provideConfigFilePath(): string
2727
{
2828
return __DIR__ . '/config/fractor.php';
2929
}

packages/fractor-fluid/tests/FluidFileProcessor/FluidFileProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function provideData(): Iterator
2323
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.html.fixture');
2424
}
2525

26-
public function provideConfigFilePath(): ?string
26+
public function provideConfigFilePath(): string
2727
{
2828
return __DIR__ . '/config/fractor.php';
2929
}

packages/fractor-phpstan-rules/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"require": {
1717
"php": "^8.2",
1818
"a9f/fractor": "^0.5",
19-
"phpstan/phpstan": "^1.10.9"
19+
"phpstan/phpstan": "^2.0.0"
2020
},
2121
"minimum-stability": "dev",
2222
"prefer-stable": true,

packages/fractor-phpstan-rules/src/Rules/AddChangelogDocBlockForFractorRule.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use PHPStan\Analyser\Scope;
1414
use PHPStan\Reflection\ReflectionProvider;
1515
use PHPStan\Rules\Rule;
16+
use PHPStan\Rules\RuleErrorBuilder;
1617
use PHPStan\Type\FileTypeMapper;
1718

1819
/**
@@ -72,7 +73,11 @@ public function processNode(Node $node, Scope $scope): array
7273

7374
$docComment = $node->getDocComment();
7475
if (! $docComment instanceof Doc) {
75-
return [sprintf(self::ERROR_MESSAGE, $className)];
76+
return [
77+
RuleErrorBuilder::message(sprintf(self::ERROR_MESSAGE, $className))
78+
->identifier('change.docblock')
79+
->build(),
80+
];
7681
}
7782

7883
$resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc(
@@ -88,6 +93,10 @@ public function processNode(Node $node, Scope $scope): array
8893
return [];
8994
}
9095

91-
return [sprintf(self::ERROR_MESSAGE, $className)];
96+
return [
97+
RuleErrorBuilder::message(sprintf(self::ERROR_MESSAGE, $className))
98+
->identifier('change.docblock')
99+
->build(),
100+
];
92101
}
93102
}

0 commit comments

Comments
 (0)