File tree Expand file tree Collapse file tree 3 files changed +32
-6
lines changed
rules-tests/Php83/Rector/ClassConst/AddTypeToConstRector/Fixture
rules/Php83/Rector/ClassConst Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -467,5 +467,12 @@ parameters:
467467
468468 # false positive
469469 -
470- identifier : phpstanApi.varTagAssumption
471- path : rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php
470+ identifier : phpstanApi.varTagAssumption
471+ path : rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php
472+
473+ # bug, fix in symplify/phpstan-rules
474+ -
475+ identifier : symplify.noMissnamedDocTag
476+ paths :
477+ - rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php
478+ - rules/TypeDeclarationDocblocks/TypeResolver/ConstantArrayTypeGeneralizer.php
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \Php83 \Rector \ClassConst \AddTypeToConstRector \Fixture ;
4+
5+ abstract class HandlePrivateAbstract
6+ {
7+ private const VALUE = 1000 ;
8+ }
9+ ?>
10+ -----
11+ <?php
12+
13+ namespace Rector \Tests \Php83 \Rector \ClassConst \AddTypeToConstRector \Fixture ;
14+
15+ abstract class HandlePrivateAbstract
16+ {
17+ private const int VALUE = 1000 ;
18+ }
19+ ?>
Original file line number Diff line number Diff line change @@ -78,10 +78,6 @@ public function refactor(Node $node): ?Class_
7878 return null ;
7979 }
8080
81- if ($ node ->isAbstract ()) {
82- return null ;
83- }
84-
8581 $ classConsts = $ node ->getConstants ();
8682 if ($ classConsts === []) {
8783 return null ;
@@ -99,6 +95,10 @@ public function refactor(Node $node): ?Class_
9995 }
10096
10197 foreach ($ classConst ->consts as $ constNode ) {
98+ if ($ node ->isAbstract () && ! $ classConst ->isPrivate ()) {
99+ continue ;
100+ }
101+
102102 if ($ this ->isConstGuardedByParents ($ constNode , $ parentClassReflections )) {
103103 continue ;
104104 }
You can’t perform that action at this time.
0 commit comments