Skip to content

Commit 080d51d

Browse files
Remove Core namespace (#210)
* Remove Core namespace * tidy up phpstan * misc * fix type * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <[email protected]>
1 parent 90fbaf5 commit 080d51d

File tree

102 files changed

+167
-194
lines changed

Some content is hidden

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

102 files changed

+167
-194
lines changed

composer.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@
99
"require-dev": {
1010
"phpstan/extension-installer": "^1.3",
1111
"phpstan/phpstan": "^1.10",
12-
"phpstan/phpstan-deprecation-rules": "^1.1",
1312
"phpstan/phpstan-webmozart-assert": "^1.2",
1413
"phpunit/phpunit": "^10.3",
15-
"rector/phpstan-rules": "^0.7",
14+
"rector/phpstan-rules": "^0.7.4",
1615
"rector/rector-generator": "^0.7.3",
1716
"rector/rector-src": "dev-main",
18-
"symplify/easy-ci": "^11.2",
1917
"symplify/easy-coding-standard": "^12.0",
2018
"symplify/phpstan-extensions": "^11.3",
21-
"symplify/phpstan-rules": "^12.0",
19+
"symplify/phpstan-rules": "^12.4",
2220
"symplify/rule-doc-generator": "^12.0",
2321
"symplify/vendor-patches": "^11.2",
24-
"tomasvotruba/class-leak": "^0.1",
25-
"tomasvotruba/cognitive-complexity": "^0.1",
26-
"tomasvotruba/type-coverage": "^0.2",
27-
"tomasvotruba/unused-public": "^0.2",
22+
"tomasvotruba/class-leak": "^0.2",
2823
"tracy/tracy": "^2.10"
2924
},
3025
"autoload": {

config/set/downgrade-php72.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Core\ValueObject\PhpVersion;
6+
use Rector\ValueObject\PhpVersion;
77
use Rector\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector;
88
use Rector\DowngradePhp72\Rector\ConstFetch\DowngradePhp72JsonConstRector;
99
use Rector\DowngradePhp72\Rector\FuncCall\DowngradeJsonDecodeNullAssociativeArgRector;

config/set/downgrade-php73.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Core\ValueObject\PhpVersion;
6+
use Rector\ValueObject\PhpVersion;
77
use Rector\DowngradePhp73\Rector\ConstFetch\DowngradePhp73JsonConstRector;
88
use Rector\DowngradePhp73\Rector\FuncCall\DowngradeArrayKeyFirstLastRector;
99
use Rector\DowngradePhp73\Rector\FuncCall\DowngradeIsCountableRector;

config/set/downgrade-php74.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Core\ValueObject\PhpVersion;
6+
use Rector\ValueObject\PhpVersion;
77
use Rector\DowngradePhp74\Rector\Array_\DowngradeArraySpreadRector;
88
use Rector\DowngradePhp74\Rector\ArrowFunction\ArrowFunctionToAnonymousFunctionRector;
99
use Rector\DowngradePhp74\Rector\ClassMethod\DowngradeContravariantArgumentTypeRector;

config/set/downgrade-php80.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Rector\DowngradePhp80\Rector\ClassMethod\RemoveReturnTypeDeclarationFromCloneRector;
55

66
use Rector\Config\RectorConfig;
7-
use Rector\Core\ValueObject\PhpVersion;
7+
use Rector\ValueObject\PhpVersion;
88
use Rector\DowngradePhp80\Rector\ArrayDimFetch\DowngradeDereferenceableOperationRector;
99
use Rector\DowngradePhp80\Rector\Catch_\DowngradeNonCapturingCatchesRector;
1010
use Rector\DowngradePhp80\Rector\Class_\DowngradeAttributeToAnnotationRector;

config/set/downgrade-php81.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Rector\DowngradePhp81\Rector\LNumber\DowngradeOctalNumberRector;
77
use Rector\DowngradePhp81\Rector\MethodCall\DowngradeIsEnumRector;
88
use Rector\Config\RectorConfig;
9-
use Rector\Core\ValueObject\PhpVersion;
9+
use Rector\ValueObject\PhpVersion;
1010
use Rector\DowngradePhp81\Rector\Array_\DowngradeArraySpreadStringKeyRector;
1111
use Rector\DowngradePhp81\Rector\ClassConst\DowngradeFinalizePublicClassConstantRector;
1212
use Rector\DowngradePhp81\Rector\FuncCall\DowngradeArrayIsListRector;

config/set/downgrade-php82.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Core\ValueObject\PhpVersion;
6+
use Rector\ValueObject\PhpVersion;
77
use Rector\DowngradePhp82\Rector\Class_\DowngradeReadonlyClassRector;
88
use Rector\DowngradePhp82\Rector\FunctionLike\DowngradeStandaloneNullTrueFalseReturnTypeRector;
99

phpstan.neon

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,19 @@ parameters:
1616
- tests
1717
- rules-tests
1818

19-
2019
excludePaths:
2120
# tests files
2221
- "*/Expected/*"
2322
- '*/Fixture/*'
2423
- '*/Source/*'
2524

26-
cognitive_complexity:
27-
class: 30
28-
function: 10
29-
3025
ignoreErrors:
3126
# php enum value minus
3227
- '#Parameter \#1 \$phpVersion of method Rector\\Config\\RectorConfig\:\:phpVersion\(\) expects (.*?), (.*?) given#'
3328

3429
# part of implicit contract
3530
- '#Call to an undefined method PHPStan\\Type\\ConstantType\:\:getValue\(\)#'
3631

37-
# part of tests
38-
- '#Class Rector\\Tests\\DowngradePhp72\\Rector\\ClassMethod\\DowngradeParameterTypeWideningRector\\Fixture\\SomeContainerInterface not found#'
39-
4032
- '#Calling PHPStan\\Reflection\\Native\\NativeFunctionReflection\:\:getName\(\) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version#'
4133

4234
-
@@ -60,10 +52,6 @@ parameters:
6052
message: '#New objects with "\$returnType" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
6153
path: src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php
6254

63-
-
64-
message: '#Class cognitive complexity is 32, keep it under 30#'
65-
path: rules/DowngradePhp73/Rector/List_/DowngradeListReferenceAssignmentRector.php
66-
6755
- '#Parameter \#3 \$stmt of method Rector\\DowngradePhp72\\Rector\\FuncCall\\DowngradePregUnmatchedAsNullConstantRector\:\:processReplace\(\) expects PhpParser\\Node\\Stmt, PhpParser\\Node given#'
6856

6957
- '#(.*?)\:\:refactor\(\) should return array<PhpParser\\Node\\Stmt>\|PhpParser\\Node\\Stmt\\ClassConst\|null but returns array<PhpParser\\Node\\Stmt>\|PhpParser\\Node\\Stmt\|null#'
@@ -72,22 +60,9 @@ parameters:
7260
message: '#Use value object over return of values#'
7361
path: rules/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector.php
7462

75-
-
76-
message: '#Class cognitive complexity is \d+, keep it under 30#'
77-
path: rules/DowngradePhp80/Rector/Expression/DowngradeMatchToSwitchRector.php
78-
79-
-
80-
message: '#Cognitive complexity for "Rector\\DowngradePhp80\\Rector\\Expression\\DowngradeMatchToSwitchRector\:\:refactorWithScope\(\)" is 38, keep it under 10#'
81-
path: rules/DowngradePhp80/Rector/Expression/DowngradeMatchToSwitchRector.php
82-
8363
# phpstan need to load rector nodes first to avoid this
8464
- '#Rector\\Core\\Contract\\PhpParser\\Node\\StmtsAwareInterface#'
8565

8666
-
8767
message: '#Parameter \#1 \$attributeClass of class Rector\\DowngradePhp80\\ValueObject\\DowngradeAttributeToAnnotation constructor expects class\-string, string given#'
8868
path: "config/*"
89-
90-
# we need exact types
91-
- '#Doing instanceof PHPStan\\Type\\(.*?) is error\-prone and deprecated#'
92-
# easier to run for simple cases
93-
- '#Call to deprecated method getTypeFromValue\(\) of class PHPStan\\Type\\ConstantTypeHelper#'

rules-tests/DowngradePhp72/Rector/FunctionLike/DowngradeObjectTypeDeclarationRector/config/configured_rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use Rector\Config\RectorConfig;
66

7-
use Rector\Core\ValueObject\PhpVersionFeature;
87
use Rector\DowngradePhp72\Rector\FunctionLike\DowngradeObjectTypeDeclarationRector;
8+
use Rector\ValueObject\PhpVersionFeature;
99

1010
return static function (RectorConfig $rectorConfig): void {
1111
$rectorConfig->rule(DowngradeObjectTypeDeclarationRector::class);

rules-tests/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector/config/configured_rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Core\ValueObject\PhpVersionFeature;
76
use Rector\DowngradePhp74\Rector\ClassMethod\DowngradeCovariantReturnTypeRector;
7+
use Rector\ValueObject\PhpVersionFeature;
88

99
return static function (RectorConfig $rectorConfig): void {
1010
$rectorConfig->rule(DowngradeCovariantReturnTypeRector::class);

0 commit comments

Comments
 (0)