File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed
rules/DeadCode/Rector/Expression
src/NodeTypeResolver/Node Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 5656 "rector/type-perfect" : " ^2.1" ,
5757 "shipmonk/composer-dependency-analyser" : " ^1.8" ,
5858 "symplify/phpstan-extensions" : " ^12.0.2" ,
59- "symplify/phpstan-rules" : " dev-main#669b317 " ,
59+ "symplify/phpstan-rules" : " dev-main" ,
6060 "symplify/vendor-patches" : " ^11.5" ,
6161 "tomasvotruba/class-leak" : " ^2.1" ,
6262 "tomasvotruba/unused-public" : " ^2.1" ,
Original file line number Diff line number Diff line change 1111use PhpParser \Node \Stmt \Nop ;
1212use PhpParser \NodeVisitor ;
1313use PHPStan \Reflection \Php \PhpPropertyReflection ;
14- use Rector \BetterPhpDocParser \PhpDocInfo \PhpDocInfoFactory ;
1514use Rector \DeadCode \NodeManipulator \LivingCodeManipulator ;
1615use Rector \NodeAnalyzer \PropertyFetchAnalyzer ;
17- use Rector \NodeTypeResolver \Node \AttributeKey ;
1816use Rector \Rector \AbstractRector ;
1917use Rector \Reflection \ReflectionResolver ;
2018use Symplify \RuleDocGenerator \ValueObject \CodeSample \CodeSample ;
@@ -29,7 +27,6 @@ public function __construct(
2927 private readonly LivingCodeManipulator $ livingCodeManipulator ,
3028 private readonly PropertyFetchAnalyzer $ propertyFetchAnalyzer ,
3129 private readonly ReflectionResolver $ reflectionResolver ,
32- private readonly PhpDocInfoFactory $ phpDocInfoFactory
3330 ) {
3431 }
3532
@@ -111,11 +108,9 @@ private function hasGetMagic(Expression $expression): bool
111108 */
112109 private function removeNodeAndKeepComments (Expression $ expression ): int |Node
113110 {
114- $ phpDocInfo = $ this ->phpDocInfoFactory ->createFromNodeOrEmpty ($ expression );
115-
116111 if ($ expression ->getComments () !== []) {
117112 $ nop = new Nop ();
118- $ nop ->setAttribute (AttributeKey:: PHP_DOC_INFO , $ phpDocInfo );
113+ $ nop ->setDocComment ( $ expression -> getDocComment () );
119114
120115 return $ nop ;
121116 }
Original file line number Diff line number Diff line change @@ -81,11 +81,6 @@ final class AttributeKey
8181 */
8282 public const IS_REGULAR_PATTERN = 'is_regular_pattern ' ;
8383
84- /**
85- * @var string
86- */
87- public const DO_NOT_CHANGE = 'do_not_change ' ;
88-
8984 /**
9085 * Helps with infinite loop detection
9186 * @var string
@@ -114,6 +109,7 @@ final class AttributeKey
114109 public const EXTRA_USE_IMPORT = 'extra_use_import ' ;
115110
116111 /**
112+ * Used internally by php-parser
117113 * @var string
118114 */
119115 public const DOC_LABEL = 'docLabel ' ;
You can’t perform that action at this time.
0 commit comments