2018-09-14 18:01:40 +02:00
includes :
2020-04-25 16:42:43 +02:00
- utils/phpstan-extensions/config/phpstan-extensions.neon
2020-12-11 18:25:42 +01:00
# allows symplify error formatter
2020-04-25 16:42:43 +02:00
- vendor/symplify/phpstan-extensions/config/config.neon
2018-09-14 18:01:40 +02:00
2020-11-09 20:14:57 +07:00
# see https://github.com/symplify/coding-standard
2020-11-16 17:50:38 +00:00
# - vendor/symplify/phpstan-rules/config/configurable-rules.neon
- vendor/symplify/phpstan-rules/config/static-rules.neon
2020-11-17 11:22:53 +00:00
- vendor/symplify/phpstan-rules/config/services/services.neon
2020-11-16 17:50:38 +00:00
- vendor/symplify/phpstan-rules/packages/cognitive-complexity/config/cognitive-complexity-services.neon
2020-12-11 18:25:42 +01:00
- vendor/symplify/phpstan-rules/config/array-rules.neon
- vendor/symplify/phpstan-rules/config/code-complexity-rules.neon
- vendor/symplify/phpstan-rules/config/doctrine-rules.neon
- vendor/symplify/phpstan-rules/config/naming-rules.neon
- vendor/symplify/phpstan-rules/config/regex-rules.neon
- vendor/symplify/phpstan-rules/config/services-rules.neon
- vendor/symplify/phpstan-rules/config/size-rules.neon
- vendor/symplify/phpstan-rules/config/forbidden-static-rules.neon
- vendor/symplify/phpstan-rules/config/string-to-constant-rules.neon
- vendor/symplify/phpstan-rules/config/symfony-rules.neon
- vendor/symplify/phpstan-rules/config/test-rules.neon
2020-09-23 11:16:40 +02:00
services :
2020-12-10 00:40:38 +01:00
-
class : Symplify\PHPStanRules\Rules\ForbiddenMethodCallOnTypeRule
tags : [ phpstan.rules.rule]
arguments :
forbiddenMethodNamesByTypes :
PhpParser\Node :
- 'getDocComment'
- 'getComments'
- 'setDocComment'
2020-12-09 23:35:48 +01:00
-
class : Symplify\PHPStanRules\Rules\OnlyOneClassMethodRule
tags : [ phpstan.rules.rule]
arguments :
onlyOneMethodsByType :
Rector\Testing\PHPUnit\AbstractRectorTestCase :
- getRectorClass
- provideConfigFileInfo
- getRectorsWithConfiguration
2020-12-09 23:25:53 +01:00
-
2020-12-11 16:58:51 +08:00
class : Symplify\PHPStanRules\Rules\ForbiddenNodeRule
2020-12-09 23:25:53 +01:00
tags : [ phpstan.rules.rule]
arguments :
forbiddenNodes :
- PhpParser\Node\Expr\ErrorSuppress
- PhpParser\Node\Stmt\Switch_
- PhpParser\Node\Expr\Empty_
2020-11-27 21:39:42 +01:00
-
class : Symplify\PHPStanRules\Rules\RequireClassTypeInClassMethodByTypeRule
tags : [ phpstan.rules.rule]
arguments :
requiredTypeInMethodByClass :
Rector\Core\Contract\Rector\PhpRectorInterface :
getNodeTypes : 'PhpParser\Node'
2020-10-02 12:01:53 +02:00
-
2020-11-16 17:50:38 +00:00
class : Symplify\PHPStanRules\CognitiveComplexity\Rules\FunctionLikeCognitiveComplexityRule
2020-10-02 12:01:53 +02:00
tags : [ phpstan.rules.rule]
arguments :
maxMethodCognitiveComplexity : 9
-
2020-11-16 17:50:38 +00:00
class : Symplify\PHPStanRules\CognitiveComplexity\Rules\ClassLikeCognitiveComplexityRule
2020-10-02 12:01:53 +02:00
tags : [ phpstan.rules.rule]
arguments :
maxClassCognitiveComplexity : 50
2020-11-27 21:39:42 +01:00
limitsByTypes :
Rector\Core\Rector\AbstractRector : 40
Symfony\Component\Console\Command\Command : 40
PHPStan\Rule\Rule : 30
2020-10-02 12:01:53 +02:00
2020-09-24 20:54:39 +02:00
# require constant in argument position
2020-10-01 21:45:29 +02:00
-
2020-11-16 17:50:38 +00:00
class : Symplify\PHPStanRules\Rules\RequireMethodCallArgumentConstantRule
2020-10-01 21:45:29 +02:00
tags : [ phpstan.rules.rule]
arguments :
constantArgByMethodByType :
Symfony\Component\Console\Command\Command :
addArgument : [ 0 ]
addOption : [ 0 ]
Symfony\Component\Console\Input\InputInterface :
getOption : [ 0 ]
getArgument : [ 0 ]
PhpParser\Node :
getAttribute : [ 0 ]
2020-12-05 00:22:12 +01:00
hasAttribute : [ 0 ]
2020-10-01 21:45:29 +02:00
setAttribute : [ 0 ]
2020-09-24 20:54:39 +02:00
2020-09-23 11:16:40 +02:00
-
2020-11-16 17:50:38 +00:00
class : Symplify\PHPStanRules\Rules\SeeAnnotationToTestRule
2020-09-23 11:16:40 +02:00
tags : [ phpstan.rules.rule]
arguments :
requiredSeeTypes :
- PHPStan\Rules\Rule
- Rector\Core\Rector\AbstractRector
# this rule prevents bug in phar like these: https://github.com/rectorphp/rector/pull/3692/files
-
2020-11-16 17:50:38 +00:00
class : Symplify\PHPStanRules\Rules\RequireStringArgumentInMethodCallRule
2020-09-23 11:16:40 +02:00
tags : [ phpstan.rules.rule]
arguments :
stringArgByMethodByType :
Rector\Core\Rector\AbstractRector :
isObjectType : [ 1 ]
-
2020-11-16 17:50:38 +00:00
class : Symplify\PHPStanRules\Rules\ClassNameRespectsParentSuffixRule
2020-09-23 11:16:40 +02:00
tags : [ phpstan.rules.rule]
arguments :
parentClasses :
- Rector
2020-12-11 18:25:42 +01:00
-
class : Symplify\PHPStanRules\Rules\PreferredClassRule
tags : [ phpstan.rules.rule]
arguments :
oldToPreferredClasses :
# prevent PHPStorm autocomplete mess
'Symfony\Component\DependencyInjection\Variable' : 'PhpParser\Node\Expr\Variable'
'phpDocumentor\Reflection\Types\Expression' : 'PhpParser\Node\Stmt\Expression'
'phpDocumentor\Reflection\DocBlock\Tags\Param' : 'PhpParser\Node\Param'
'phpDocumentor\Reflection\DocBlock\Tags\Return_' : 'PhpParser\Node\Stmt\Return_'
'Closure' : 'PhpParser\Node\Expr\Closure'
'PHPUnit\TextUI\Configuration\Variable' : 'PhpParser\Node\Expr\Variable'
'SebastianBergmann\Type\MixedType' : 'PHPStan\Type\MixedType'
'Hoa\Protocol\Node\Node' : 'PhpParser\Node'
'Nette\Utils\FileSystem' : 'Symplify\SmartFileSystem\SmartFileSystem'
'Symfony\Component\Filesystem\Filesystem' : 'Symplify\SmartFileSystem\SmartFileSystem'
# builder typo nodes
PhpParser\Builder\Use_ : Rector\Core\PhpParser\Builder\UseBuilder
PhpParser\Builder\Class_ : Rector\Core\PhpParser\Builder\ClassBuilder
PhpParser\Builder\Method : Rector\Core\PhpParser\Builder\MethodBuilder
PhpParser\Builder\Namespace_ : Rector\Core\PhpParser\Builder\NamespaceBuilder
PhpParser\Builder\Param : Rector\Core\PhpParser\Builder\ParamBuilder
PhpParser\Builder\Property : Rector\Core\PhpParser\Builder\PropertyBuilder
PhpParser\Builder\TraitUse : Rector\Core\PhpParser\Builder\TraitUseBuilder
2020-07-13 11:46:55 +02:00
2017-11-06 11:40:43 +01:00
parameters :
2019-12-28 11:33:33 +01:00
level : max
2019-12-08 22:00:38 +01:00
2020-02-06 20:15:36 +01:00
paths :
2020-02-11 14:11:47 +01:00
- bin
2020-02-06 20:15:36 +01:00
- src
2020-02-11 14:11:47 +01:00
- rules
2020-02-06 20:15:36 +01:00
- packages
- tests
2020-05-07 01:10:51 +02:00
- utils
2020-08-25 00:26:14 +02:00
# this cannot be put it, because it wipes PHPStan cache on each run :( - must run in separate
2020-09-23 11:16:40 +02:00
#- config
2020-02-06 20:15:36 +01:00
2020-10-02 12:01:53 +02:00
# to allow installing with various phsptan versions without reporting old errors here
bootstrapFiles :
- vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php
scanDirectories :
- stubs
reportUnmatchedIgnoredErrors : false
checkGenericClassInNonGenericObjectType : false
2018-09-14 18:01:40 +02:00
excludes_analyse :
2020-10-27 16:51:44 +01:00
- */config.php
2020-10-29 22:34:51 +01:00
- packages/*/config/*
- tests/debug_functions.php
2020-10-27 16:51:44 +01:00
2020-10-25 14:56:11 +01:00
# broken in PHPStan https://github.com/rectorphp/rector/runs/1305002460#step:5:56
2020-10-29 23:06:26 +01:00
- packages/better-php-doc-parser/src/ValueObject/PhpDocNode/AbstractTagValueNode.php
2020-10-31 13:59:40 +01:00
- packages/testing/src/PHPUnit/*.php
2020-11-01 16:57:12 +01:00
- packages/node-type-resolver/tests/NodeVisitor/FunctionMethodAndClassNodeVisitor/FunctionMethodAndClassNodeVisitorTest.php
2020-10-25 14:56:11 +01:00
2020-05-10 23:02:46 +02:00
# phsptan bug
- utils/phpstan-extensions/src/Rule/KeepRectorNamespaceForRectorRule.php
2020-07-29 00:09:47 +02:00
- packages/rector-generator/templates/*
2020-10-11 16:17:43 +02:00
# this invalidates whole cache everytime
- 'packages/symfony-php-config/*'
- 'packages/simple-php-doc-parser'
2020-05-10 23:02:46 +02:00
2020-04-01 03:55:44 +02:00
# generated files
2020-04-03 15:28:29 +02:00
- 'packages/doctrine-annotation-generated/src/ConstantPreservingDocParser.php'
- 'packages/doctrine-annotation-generated/src/ConstantPreservingAnnotationReader.php'
2019-09-15 20:54:06 +02:00
- "*/Expected/*"
2019-02-21 15:36:16 +01:00
# complex printer
2019-03-09 12:55:17 +00:00
- '*tests/Rector/MethodCall/RenameMethodRector/**/SomeClass.php'
2018-09-14 18:01:40 +02:00
# tests files
2019-03-27 17:46:25 +01:00
- '*tests/*/Fixture/*'
- '*tests/*/Source/*'
- '*tests/Source/*'
2018-10-21 21:43:47 +02:00
# part of composer
2019-05-23 08:02:49 +02:00
- '*/tests/Rector/Psr4/MultipleClassFileToPsr4ClassesRector/Expected/Just*ExceptionWithoutNamespace.php'
2018-09-14 18:01:40 +02:00
2020-08-30 23:29:39 +02:00
# tests
- tests/DependencyInjection/config
2017-11-06 11:40:43 +01:00
ignoreErrors :
2019-01-12 20:36:34 +01:00
# false positive
- '#PHPDoc tag \@param for parameter \$node with type float is incompatible with native type PhpParser\\Node#'
2019-07-09 11:27:55 -03:00
# misuse of interface and class
2019-01-14 23:05:14 +01:00
- '#Parameter \#1 (.*?) expects Symfony\\Component\\DependencyInjection\\ContainerBuilder, Symfony\\Component\\DependencyInjection\\ContainerInterface given#'
2018-10-22 19:17:17 +02:00
- '#Strict comparison using === between string and null will always evaluate to false#'
2018-07-25 13:06:07 +02:00
2019-07-09 11:27:55 -03:00
# false positive - type is set by annotation above
2018-11-07 21:53:19 +01:00
- '#Array \(array<PhpParser\\Node\\Stmt>\) does not accept PhpParser\\Node#'
2018-08-31 00:57:59 +02:00
2019-07-09 11:27:55 -03:00
# irrelevant
2018-10-22 12:43:10 +02:00
- '#Call to function in_array\(\) with arguments string, (.*?) and true will always evaluate to false#'
2018-07-25 13:06:07 +02:00
# known values
2018-12-15 13:47:01 +01:00
- '#Access to an undefined property PhpParser\\Node\\Expr::\$right#'
2019-06-09 07:08:08 +02:00
2018-08-15 00:12:41 +02:00
- '#Access to an undefined property PhpParser\\Node\\Expr\\MethodCall\|PhpParser\\Node\\Stmt\\ClassMethod::\$params#'
2019-01-14 23:05:14 +01:00
- '#Cannot call method getName\(\) on PHPStan\\Reflection\\ClassReflection\|null#'
2019-01-14 15:10:41 +01:00
2018-10-15 21:30:38 +08:00
# false positive, has annotation type above
2018-10-21 12:32:51 +02:00
- '#Method Rector\\CodeQuality\\Rector\\Foreach_\\SimplifyForeachToCoalescingRector\:\:matchReturnOrAssignNode\(\) should return PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Stmt\\Return_\|null but returns PhpParser\\Node\|null#'
2018-11-07 18:22:27 +01:00
- '#Access to an undefined property PhpParser\\Node::\$(\w+)#'
2018-10-21 12:32:51 +02:00
2018-04-09 00:08:05 +02:00
# intentionally incorrect - part of the test
2020-02-06 22:48:18 +01:00
- '#Parameter \#2 \$codeSamples of class Rector\\Core\\RectorDefinition\\RectorDefinition constructor expects array<Rector\\Core\\Contract\\RectorDefinition\\CodeSampleInterface>, array<int, stdClass> given#'
2018-08-01 11:53:26 +02:00
2017-11-06 13:58:51 +01:00
# known values
2018-10-07 17:53:59 +08:00
- '#Cannot access property \$value on PhpParser\\Node\\Expr\\ArrayItem\|null#'
2018-04-02 15:17:12 +02:00
2019-01-14 19:21:23 +01:00
# known values
- '#Strict comparison using === between PhpParser\\Node\\Expr and null will always evaluate to false#'
2019-02-02 13:27:03 +01:00
2019-02-17 02:13:29 +01:00
- '#Access to an undefined property PhpParser\\Node\\Stmt\:\:\$expr#'
- '#Cannot access property \$stmts on PhpParser\\Node\\Stmt\\Else_\|null#'
2019-02-11 23:35:20 +01:00
2019-02-17 13:50:24 +01:00
# node finder
2019-02-18 18:46:36 +01:00
- '#Method Rector\\(.*?) should return array<PhpParser\\Node\\(.*?)> but returns array<PhpParser\\Node\>#'
2019-02-17 13:50:24 +01:00
2019-02-11 23:35:20 +01:00
# part of test
2019-02-28 22:50:53 +01:00
- '#(.*?)(AttributeAwareNodeInterface|AttributeAware(.*?)TagValueNode)(.*?)#'
- '#Parameter \#1 \$children of class PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocNode constructor expects array<PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocChildNode\>, array<int, PHPStan\\PhpDocParser\\Ast\\Node\> given#'
2019-03-13 01:49:15 +01:00
- '#Method Rector\\PHPUnit\\Rector\\MethodCall\\ReplaceAssertArraySubsetRector\:\:matchArray\(\) should return PhpParser\\Node\\Expr\\Array_\|null but returns PhpParser\\Node\\Expr#'
2019-03-18 12:10:33 +01:00
2019-03-26 23:56:10 +01:00
- '#(.*?)PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable given#'
2019-03-27 17:46:25 +01:00
# false positive 0.11.5
- '#Unreachable statement \- code above always terminates#'
2019-03-31 14:45:15 +02:00
- '#Negated boolean expression is always true#'
2019-03-31 21:30:26 +02:00
- '#Strict comparison using \=\=\= between PhpParser\\Node and null will always evaluate to false#'
2019-04-14 00:37:05 +02:00
# known types
2019-04-25 15:28:01 +02:00
- '#Access to an undefined property PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable\:\:\$name#'
2019-05-07 15:37:50 +02:00
- '#Strict comparison using \=\=\= between PhpParser\\Node\\Expr\\ArrayItem and null will always evaluate to false#'
2019-05-09 15:30:39 +02:00
- '#Parameter \#2 \.\.\.\$args of function array_merge expects array, array<int, string\>\|false given#'
2019-05-11 15:22:57 +02:00
- '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$args#'
2019-05-11 15:07:00 +02:00
2020-02-06 22:48:18 +01:00
- '#Parameter \#2 \$name of method Rector\\Core\\Rector\\AbstractRector\:\:isName\(\) expects string, string\|null given#'
2019-07-09 11:27:55 -03:00
# cascade irrelevant
2019-05-19 23:44:38 +02:00
- '#Parameter (.*?) expects array<PhpParser\\Node\\Stmt\>, array<PhpParser\\Node\> given#'
2019-05-23 19:32:46 +02:00
# known value
2019-05-25 18:36:53 +02:00
- '#Cannot cast array<string\>\|bool\|string\|null to string#'
2019-06-04 17:41:23 +03:00
2019-07-22 12:49:50 +02:00
# array is callable
2019-08-04 13:05:40 +02:00
- '#If condition is always true#'
2019-08-03 21:41:46 +02:00
2019-08-06 11:14:50 +02:00
- '#Ternary operator condition is always true#'
2019-08-19 16:52:02 +02:00
2019-08-31 10:08:37 +02:00
- '#Access to an undefined property PhpParser\\Node\\FunctionLike\|PhpParser\\Node\\Stmt\\ClassLike\:\:\$stmts#'
2019-08-19 16:52:02 +02:00
2019-09-01 22:38:31 +02:00
- '#Property Rector\\TypeDeclaration\\TypeInferer\\(.*?)\:\:\$(.*?)TypeInferers \(array<Rector\\TypeDeclaration\\Contract\\TypeInferer\\(.*?)TypeInfererInterface\>\) does not accept array<Rector\\TypeDeclaration\\Contract\\TypeInferer\\PriorityAwareTypeInfererInterface\>#'
# sense-less errors
2019-08-19 16:52:02 +02:00
# PHP 7.4 1_000 support
- '#Property PhpParser\\Node\\Scalar\\DNumber\:\:\$value \(float\) does not accept string#'
- '#Call to function is_string\(\) with float will always evaluate to false#'
2019-09-14 18:11:14 +02:00
2019-11-04 01:48:08 +01:00
- '#Method Rector\\NodeTypeResolver\\PHPStan\\Type\\TypeFactory\:\:createUnionOrSingleType\(\) should return PHPStan\\Type\\MixedType\|PHPStan\\Type\\UnionType but returns PHPStan\\Type\\Type#'
2019-11-04 17:30:10 +01:00
2019-12-08 11:03:08 +01:00
-
2020-07-29 01:41:20 +02:00
message : '#Class Rector\\Generic\\Tests\\Rector\\StaticCall\\SwapClassMethodArgumentsRector\\Fixture\\SomeClass not found#'
path : rules/generic/tests/Rector/StaticCall/SwapClassMethodArgumentsRector/SwapClassMethodArgumentsRectorTest.php
2019-12-08 18:01:29 +01:00
2020-06-19 15:37:24 +02:00
# internal rule
- '#Class "Rector\\Utils\\(.*?)" is missing @see annotation with test case class reference#'
2019-12-08 22:00:38 +01:00
# mixed
- '#Offset int\|string\|null does not exist on array<PhpParser\\Node\\Stmt>\|null#'
- '#class-string<T of object>\|T of object#'
# known values
- '#Offset 0 does not exist on array<PhpParser\\Node\\Stmt>\|null#'
- '#Parameter \#1 \$left of class PhpParser\\Node\\Expr\\BinaryOp\\Spaceship constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#'
- '#Parameter \#2 \$right of class PhpParser\\Node\\Expr\\BinaryOp\\Spaceship constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#'
# false positive
- '#Comparison operation "<" between 0 and 2 is always true#'
2019-12-16 15:45:37 +01:00
2020-08-12 11:08:59 +02:00
- '#Method Rector\\Symfony\\Rector\\MethodCall\\AbstractToConstructorInjectionRector\:\:getServiceTypeFromMethodCallArgument\(\) should return PHPStan\\Type\\Type but returns PHPStan\\Type\\Type\|null#'
2019-12-24 11:45:52 +01:00
2019-12-30 20:10:43 +01:00
- '#Parameter \#1 \$expected of method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) expects class\-string<object\>, string given#'
- '#Unable to resolve the template type ExpectedType in call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\)#'
2020-01-04 20:24:42 +01:00
2020-01-06 14:38:37 +01:00
# fix Symplify 7.2 later
- '#Method (.*?) returns bool type, so the name should start with is/has/was#'
2020-01-07 13:04:09 +01:00
2020-01-18 21:57:35 +01:00
- '#In method "Rector\\BetterPhpDocParser\\AnnotationReader\\NodeAnnotationReader\:\:createPropertyReflectionFromPropertyNode", caught "Throwable" must be rethrown\. Either catch a more specific exception or add a "throw" clause in the "catch" block to propagate the exception\. More info\: http\://bit\.ly/failloud#'
2020-01-21 14:32:40 +01:00
# doc is not enough
- '#Result of \|\| is always true#'
2020-01-21 16:36:31 +01:00
# known value
2020-01-28 17:01:22 +01:00
- '#Parameter \#2 \$name of class PhpParser\\Node\\Expr\\MethodCall constructor expects PhpParser\\Node\\Expr\|PhpParser\\Node\\Identifier\|string, string\|null given#'
2020-01-29 14:36:09 +01:00
2020-02-02 19:15:36 +01:00
- '#Parameter \#1 \$eventListenerTag of method Rector\\SymfonyCodeQuality\\Rector\\Class_\\EventListenerToEventSubscriberRector\:\:createEventItem\(\) expects Rector\\Symfony\\ValueObject\\Tag\\EventListenerTag, Rector\\Symfony\\Contract\\Tag\\TagInterface given#'
2020-02-02 19:15:36 +01:00
- '#Method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfoFactory\:\:parseTokensToPhpDocNode\(\) should return Rector\\AttributeAwarePhpDoc\\Ast\\PhpDoc\\AttributeAwarePhpDocNode but returns PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocNode#'
2020-02-04 16:14:40 +01:00
- '#Call to an undefined method PHPStan\\Type\\Type\:\:getClassName\(\)#'
2020-02-10 10:17:05 +01:00
- '#Parameter \#1 \$typeNode of method Rector\\StaticTypeMapper\\StaticTypeMapper\:\:mapPHPStanPhpDocTypeNodeToPHPStanType\(\) expects PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode, PHPStan\\PhpDocParser\\Ast\\Node given#'
2020-02-06 22:48:18 +01:00
- '#Parameter \#1 \$sprintfFuncCall of method Rector\\Core\\PhpParser\\NodeTransformer\:\:transformSprintfToArray\(\) expects PhpParser\\Node\\Expr\\FuncCall, PhpParser\\Node given#'
- '#Parameter \#1 \$nodes of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:find\(\) expects array<PhpParser\\Node\>\|PhpParser\\Node, array<PhpParser\\Node\\Stmt\>\|null given#'
2020-02-09 10:32:51 +01:00
- '#Method Rector\\SOLID\\Reflection\\ParentConstantReflectionResolver\:\:(.*?)\(\) should return ReflectionClassConstant\|null but returns ReflectionClassConstant\|false#'
2020-08-18 17:57:30 +02:00
- '#Parameter \#1 \$firstStmt of method Rector\\Generic\\Rector\\ClassMethod\\NormalToFluentRector\:\:isBothMethodCallMatch\(\) expects PhpParser\\Node\\Stmt\\Expression, PhpParser\\Node\\Stmt given#'
2020-02-10 10:32:18 +01:00
- '#Method Rector\\Core\\Rector\\AbstractRector\:\:wrapToArg\(\) should return array<PhpParser\\Node\\Arg\> but returns array<PhpParser\\Node\\Arg\|PhpParser\\Node\\Expr\>#'
2020-02-11 14:11:47 +01:00
2020-02-16 22:29:32 +01:00
- '#Cannot call method (.*?)\(\) on Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\|null#'
2020-02-18 23:09:25 +01:00
- '#Parameter \#(.*?) (.*?) of class PhpParser\\Node\\Expr\\BinaryOp\\(.*?) constructor expects PhpParser\\Node\\Expr, PhpParser\\Node given#'
2020-02-23 18:20:00 +01:00
2020-02-29 17:18:20 +01:00
- '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\:\:\$description#'
2020-03-26 23:22:29 +01:00
- '#Method Rector\\Php80\\Rector\\NotIdentical\\StrContainsRector\:\:matchNotIdenticalToFalse\(\) should return PhpParser\\Node\\Expr\\FuncCall\|null but returns PhpParser\\Node\\Expr#'
2020-03-29 03:35:25 +02:00
- '#Parameter \#2 \$name of method Rector\\Core\\Rector\\AbstractRector\:\:isVariableName\(\) expects string, string\|null given#'
2020-03-31 20:46:33 +02:00
2020-04-13 23:44:44 +02:00
# broken
- '#Cannot call method getParentNode\(\) on Rector\\DeadCode\\ValueObject\\VariableNodeUse\|null#'
- '#Parameter \#2 \$name of method Rector\\NodeNameResolver\\NodeNameResolver\:\:isName\(\) expects string, string\|null given#'
2020-04-19 19:56:05 +02:00
- '#Parameter \#1 \$keyName of method Rector\\AttributeAwarePhpDoc\\Ast\\Type\\AttributeAwareArrayShapeItemNode\:\:createKeyWithSpacePattern\(\) expects PHPStan\\PhpDocParser\\Ast\\ConstExpr\\ConstExprIntegerNode\|PHPStan\\PhpDocParser\\Ast\\Type\\IdentifierTypeNode\|null, PHPStan\\PhpDocParser\\Ast\\ConstExpr\\ConstExprIntegerNode\|PHPStan\\PhpDocParser\\Ast\\ConstExpr\\ConstExprStringNode\|PHPStan\\PhpDocParser\\Ast\\Type\\IdentifierTypeNode\|null given#'
2020-09-18 12:06:01 +02:00
- '#Method Rector\\Caching\\Detector\\ChangedFilesDetector\:\:hashFile\(\) should return string but returns string\|false#'
2020-04-01 03:55:44 +02:00
- '#If condition is always false#'
2020-04-23 23:49:56 +02:00
- '#Parameter \#1 \$funcCall of method Rector\\Php80\\MatchAndRefactor\\StrStartsWithMatchAndRefactor\\AbstractMatchAndRefactor\:\:createStrStartsWithValueObjectFromFuncCall\(\) expects PhpParser\\Node\\Expr\\FuncCall, PhpParser\\Node\\Expr given#'
2020-04-25 16:45:36 +02:00
# mostly strings in tests
2020-05-02 23:25:24 +02:00
- '#Method Rector\\Naming\\Naming\\PropertyNaming\:\:resolveShortClassName\(\) should return string but returns string\|null#'
2020-05-03 16:07:56 +02:00
2020-07-27 08:56:25 +02:00
-
message : "#in iterable type Iterator#"
paths :
- *Test.php
- *TestCase.php
2020-05-03 16:16:10 +02:00
-
message : "#^Cognitive complexity for \"Rector\\\\BetterPhpDocParser\\\\Printer\\\\WhitespaceDetector\\:\\:detectOldWhitespaces\\(\\)\" is 18, keep it under 9$#"
count : 1
path : packages/better-php-doc-parser/src/Printer/WhitespaceDetector.php
-
message : "#^Parameter \\#1 \\$input of function array_splice expects array, array\\<PhpParser\\\\Node\\\\Stmt\\>\\|null given\\.$#"
count : 1
path : rules/coding-style/src/Rector/ClassMethod/NewlineBeforeNewAssignSetRector.php
-
message : "#^Cognitive complexity for \"Rector\\\\PhpSpecToPHPUnit\\\\Rector\\\\MethodCall\\\\PhpSpecPromisesToPHPUnitAssertRector\\:\\:refactor\\(\\)\" is 13, keep it under 9$#"
count : 1
path : rules/php-spec-to-phpunit/src/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php
2020-05-07 23:58:51 +02:00
-
message : "#Use explicit property fetch names over dynamic#"
path : packages/doctrine-annotation-generated/src/PhpDocNode/ConstantReferenceIdentifierRestorer.php
2020-05-07 01:22:02 +02:00
- "#^Cognitive complexity for \"Rector\\\\Php70\\\\EregToPcreTransformer\\:\\:(.*?)\" is (.*?), keep it under 9$#"
2020-05-03 16:16:10 +02:00
2020-05-07 01:22:02 +02:00
- '#In method "Rector\\Utils\\ProjectValidator\\Process\\ParallelTaskRunner\:\:(.*?)", caught "Throwable" must be rethrown\. Either catch a more specific exception or add a "throw" clause in the "catch" block to propagate the exception#'
2020-05-07 01:10:51 +02:00
# weird
2020-05-07 01:22:02 +02:00
2020-05-07 01:10:51 +02:00
- '#Method (.*?) specified in iterable type Symfony\\Component\\Process\\Process#'
2020-05-07 01:22:02 +02:00
- '#Cannot cast PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Identifier to string#'
2020-05-07 01:51:06 +02:00
- '#Parameter \#1 \$node of method Rector\\PostRector\\Collector\\NodesToAddCollector\:\:wrapToExpression\(\) expects PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt, PhpParser\\Node given#'
- '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$class#'
- '#Method Rector\\BetterPhpDocParser\\Tests\\PhpDocParser\\AbstractPhpDocInfoTest\:\:parseFileAndGetFirstNodeOfType\(\) should return PhpParser\\Node but returns PhpParser\\Node\|null#'
2020-05-14 01:34:05 +02:00
- '#Property PhpParser\\Node\\Stmt\\Namespace_\:\:\$stmts \(array<PhpParser\\Node\\Stmt\>\) does not accept array<PhpParser\\Node\>#'
2020-05-17 12:43:03 +02:00
- '#Cognitive complexity for "Rector\\TypeDeclaration\\PHPStan\\Type\\ObjectTypeSpecifier\:\:matchShortenedObjectType\(\)" is 10, keep it under 9#'
2020-05-28 15:40:19 +02:00
- '#Parameter \#1 \$type of method PhpParser\\Builder\\FunctionLike\:\:setReturnType\(\) expects PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|string, PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType given#'
2020-05-28 21:20:16 +02:00
- '#Cognitive complexity for "Rector\\Core\\PhpParser\\Node\\Value\\ValueResolver\:\:getValue\(\)" is \d+, keep it under 9#'
2020-05-30 00:44:36 +02:00
- '#Cognitive complexity for "Rector\\NetteKdyby\\ContributeEventClassResolver\:\:resolveGetterMethodByEventClassAndParam\(\)" is \d+, keep it under 9#'
2020-06-07 10:29:13 +02:00
- '#Parameter \#1 \$type of class PhpParser\\Node\\NullableType constructor expects PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|string, PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType given#'
2020-06-18 11:49:37 +02:00
- '#Parameter \#1 \$object of function get_class expects object, PhpParser\\Node\|null given#'
2020-06-19 16:05:13 +02:00
- '#Class "Rector\\FileSystemRector\\Rector\\Removing\\RemoveProjectFileRector" is missing @see annotation with test case class reference#'
2020-06-28 13:20:25 +02:00
- '#Parameter \#1 \$type of method PhpParser\\Builder\\Param\:\:setType\(\) expects PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType\|string, PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType given#'
2020-06-29 13:44:59 +02:00
- '#Parameter \#1 \$node of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findFirstAncestorInstanceOf\(\) expects PhpParser\\Node, PhpParser\\Node\\Expr\\Variable\|null given#'
2020-07-01 23:41:49 +02:00
- '#Parameter \#1 \$objectType of method Rector\\Naming\\Naming\\PropertyNaming\:\:fqnToVariableName\(\) expects PHPStan\\Type\\ObjectType\|string, PHPStan\\Type\\Type given#'
2020-07-07 21:19:54 +02:00
# known value
- '#Property PhpParser\\Node\\Stmt\\Foreach_\:\:\$valueVar \(PhpParser\\Node\\Expr\) does not accept PhpParser\\Node\\Expr\|null#'
2020-07-12 18:35:56 +02:00
- '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\:\:\$type#'
2020-07-13 11:46:55 +02:00
2020-07-22 15:08:40 +02:00
# only local use
-
message : '#Class "Rector\\RectorGenerator\\Rector\\Closure\\AddNewServiceToSymfonyPhpConfigRector" is missing @see annotation with test case class reference#'
path : 'packages/rector-generator/src/Rector/Closure/AddNewServiceToSymfonyPhpConfigRector.php'
2020-07-14 00:22:31 +02:00
- '#Class Rector\\Renaming\\Tests\\Rector\\MethodCall\\RenameMethodRector\\Fixture\\SkipSelfMethodRename not found#'
2020-07-22 15:08:40 +02:00
# fixed in symplfiy dev
-
message : '#Separate function "Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ref\(\)" in method call to standalone row to improve readability#'
path : 'packages/rector-generator/config/config.php'
2020-07-25 00:45:24 +02:00
2020-07-26 18:34:32 +02:00
- '#Parameter \#1 \$shortControlString of method Rector\\NetteCodeQuality\\Rector\\Assign\\MakeGetComponentAssignAnnotatedRector\:\:resolveTypeFromShortControlNameAndVariable\(\) expects PhpParser\\Node\\Scalar\\String_, PhpParser\\Node\\Expr\|null given#'
2020-07-27 08:11:51 +02:00
- '#Parameter \#1 \$variable of class Rector\\Php70\\ValueObject\\VariableAssignPair constructor expects PhpParser\\Node\\Expr\\ArrayDimFetch\|PhpParser\\Node\\Expr\\PropertyFetch\|PhpParser\\Node\\Expr\\StaticPropertyFetch\|PhpParser\\Node\\Expr\\Variable, PhpParser\\Node\\Expr given#'
2020-07-27 08:56:25 +02:00
# is nested expr
- '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$expr#'
- '#Cognitive complexity for "Rector\\DeadCode\\NodeManipulator\\LivingCodeManipulator\:\:keepLivingCodeFromExpr\(\)" is \d+, keep it under 9#'
2020-07-29 00:09:47 +02:00
- '#Parameter \#1 \$files of method Symplify\\SmartFileSystem\\Finder\\FinderSanitizer\:\:sanitize\(\) expects \(iterable<SplFileInfo\|string\>&Nette\\Utils\\Finder\)\|Symfony\\Component\\Finder\\Finder, array<string\> given#'
2020-07-30 01:39:41 +02:00
- '#Static property Rector\\Core\\Testing\\PHPUnit\\AbstractGenericRectorTestCase\:\:\$allRectorContainer \(Rector\\Naming\\Tests\\Rector\\Class_\\RenamePropertyToMatchTypeRector\\Source\\ContainerInterface\|Symfony\\Component\\DependencyInjection\\Container\|null\) does not accept Psr\\Container\\ContainerInterface#'
2020-08-03 10:51:44 +02:00
# stubs
2020-08-11 12:59:04 +02:00
- '#Static property Symplify\\PackageBuilder\\Tests\\AbstractKernelTestCase\:\:\$container \(Psr\\Container\\ContainerInterface\) does not accept Rector\\Naming\\Tests\\Rector\\Class_\\RenamePropertyToMatchTypeRector\\Source\\ContainerInterface\|Symfony\\Component\\DependencyInjection\\Container#'
# wtf
-
message : '#Else branch is unreachable because ternary operator condition is always true#'
path : 'rules/psr4/src/Composer/PSR4NamespaceMatcher.php'
# false positive
- '#Parameter \#1 \$arrayItem of method Rector\\NetteKdyby\\NodeResolver\\ListeningMethodsCollector\:\:resolveCustomClassMethodAndEventClass\(\) expects PhpParser\\Node\\Expr\\ArrayItem, PhpParser\\Node given#'
2020-08-12 12:03:15 +02:00
2020-08-18 17:57:30 +02:00
-
message : '#Class "Rector\\RectorGenerator\\ValueObject\\RectorRecipe" has invalid namespace category "ValueObject"\. Pick one of\: ""#'
path : packages/rector-generator/src/ValueObject/RectorRecipe.php
2020-08-23 11:39:09 +02:00
- '#Parameter \#2 \$currentNode of method Rector\\CodingStyle\\Rector\\Assign\\ManualJsonStringToJsonEncodeArrayRector\:\:matchNextExprAssignConcatToSameVariable\(\) expects PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Expr\\AssignOp\\Concat, PhpParser\\Node given#'
-
2020-08-27 12:19:22 +02:00
message : '#Array (with keys|destruct) is not allowed\. Use value object to pass data instead#'
2020-08-23 11:39:09 +02:00
paths :
# working with cvs file
# 3rd party package
- rules/php70/src/EregToPcreTransformer.php
2020-08-23 15:39:26 +02:00
# output format
- packages/changes-reporting/src/Output/JsonOutputFormatter.php
# template variables
- packages/rector-generator/src/TemplateVariablesFactory.php
# output format to json
- rules/doctrine/src/Collector/UuidMigrationDataCollector.php
2020-08-25 00:26:14 +02:00
2020-08-27 12:19:22 +02:00
-
message : '#Use explicit return value over magic &reference#'
paths :
# 3rd party code
- rules/php70/src/EregToPcreTransformer.php
# symfony/console
-
message : '#Use explicit return value over magic &reference#'
path : 'rules/dead-code/src/Rector/BinaryOp/RemoveDuplicatedInstanceOfRector.php'
2020-08-28 23:10:00 +02:00
-
message : '#Use value object over return of values#'
path : 'rules/phpunit/src/Composer/ComposerAutoloadedDirectoryProvider.php'
2020-08-27 12:19:22 +02:00
-
2020-08-28 23:10:00 +02:00
message : '#Use value object over return of values#'
path : 'rules/php70/src/EregToPcreTransformer.php'
2020-08-31 22:32:33 +02:00
2020-09-07 17:40:46 +02:00
# new symplify rules
2020-12-11 18:25:42 +01:00
# - '#Do not use static calls#'
2020-09-07 17:40:46 +02:00
- '#Too many public elements on class \- \d+\. Try narrow it down under 10#'
2020-12-11 18:25:42 +01:00
# - '#Variable "\$attributeAwareFullyQualifiedIdentifierTypeNode" is too long with 46 chars\. Narrow it under 40 chars#'
2020-09-07 17:40:46 +02:00
# 3rd party
- '#Class cognitive complexity for "(NodeTypeResolver|EregToPcreTransformer|DumpNodesCommand)" is \d+, keep it under 50#'
2020-09-10 14:56:54 +02:00
# complex - single repository for all nodes
- '#Class cognitive complexity for "NodeRepository" is \d+, keep it under 50#'
2020-09-12 16:52:08 +07:00
2020-09-23 11:16:40 +02:00
-
message : '#Instead of "Symfony\\Component\\Finder\\SplFileInfo" class/interface use "Symplify\\SmartFileSystem\\SmartFileInfo"#'
paths :
- src/FileSystem/FilesFinder.php
2020-09-24 20:54:39 +02:00
2020-10-01 23:55:10 +07:00
-
2020-10-20 22:27:12 +02:00
message : '#Instead of container injection, use specific service#'
2020-10-01 23:55:10 +07:00
paths :
2020-10-20 22:27:12 +02:00
- src/Configuration/RectorClassesProvider.php
# nodes/stmts mixup
- '#Parameter \#2 \$stmts of class PhpParser\\Node\\Stmt\\Namespace_ constructor expects array<PhpParser\\Node\\Stmt\>\|null, array<PhpParser\\Node\> given#'
2020-10-01 23:55:10 +07:00
-
2020-10-20 22:27:12 +02:00
message : '#Nested foreach with empty statement is not allowed#'
2020-10-01 23:55:10 +07:00
paths :
2020-10-20 22:27:12 +02:00
- packages/better-php-doc-parser/tests/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php
2020-10-01 23:55:10 +07:00
-
2020-10-20 22:27:12 +02:00
message : '#Function "dump\(\)" cannot be used/left in the code#'
2020-10-01 23:55:10 +07:00
paths :
2020-10-20 22:27:12 +02:00
- tests/debug_functions.php
- '#Method Rector\\Utils\\PHPStanAttributeTypeSyncer\\NodeFactory\\AttributeAwareClassFactoryFactory\:\:createFromPhpDocParserNodeClass\(\) should return PhpParser\\Node\\Stmt\\Namespace_ but returns PhpParser\\Node#'
- '#Method Rector\\Utils\\PHPStanAttributeTypeSyncer\\NodeFactory\\AttributeAwareClassFactory\:\:createFromPhpDocParserNodeClass\(\) should return PhpParser\\Node\\Stmt\\Namespace_ but returns PhpParser\\Node#'
- '#Method Rector\\NetteKdyby\\NodeFactory\\EventValueObjectClassFactory\:\:wrapClassToNamespace\(\) should return PhpParser\\Node\\Stmt\\Namespace_ but returns PhpParser\\Node#'
2020-10-01 23:55:10 +07:00
-
2020-10-20 22:27:12 +02:00
message : '#Do not use factory/method call in constructor, put factory in config and get service with dependency injection#'
paths :
- packages/phpstan-static-type-mapper/src/PHPStanStaticTypeMapper.php # 46
- rules/nette-code-quality/src/NodeResolver/MethodNamesByInputNamesResolver.php # 25
2020-10-01 23:55:10 +07:00
2020-10-01 21:45:29 +02:00
-
2020-10-20 22:27:12 +02:00
message : '#Property with protected modifier is not allowed\. Use interface instead#'
2020-10-01 21:45:29 +02:00
paths :
2020-10-29 23:06:26 +01:00
- packages/better-php-doc-parser/src/ValueObject/PhpDocNode/AbstractTagValueNode.php
2020-10-20 22:27:12 +02:00
- rules/naming/src/Guard/PropertyConflictingNameGuard/AbstractPropertyConflictingNameGuard.php # 21
- rules/naming/src/PropertyRenamer/AbstractPropertyRenamer.php # 36
- rules/downgrade-php71/src/Rector/FunctionLike/AbstractMaybeAddDocBlockRector.php # 20
2020-10-31 13:59:40 +01:00
- packages/testing/src/PHPUnit/AbstractGenericRectorTestCase.php # 68
- packages/testing/src/PHPUnit/AbstractRectorTestCase.php # 24
2020-10-03 22:09:43 +02:00
-
2020-10-20 22:27:12 +02:00
message : '#Do not use static property#'
2020-10-03 22:09:43 +02:00
paths :
2020-10-20 22:27:12 +02:00
# 3rd party code
- packages/doctrine-annotation-generated/src/DataCollector/ResolvedConstantStaticCollector.php
# on purpose
2020-10-31 13:59:40 +01:00
- packages/testing/src/PHPUnit/AbstractGenericRectorTestCase.php # 251
2020-10-03 22:09:43 +02:00
-
message : '#Do not use factory/method call in constructor, put factory in config and get service with dependency injection#'
paths :
- packages/node-type-resolver/src/DependencyInjection/PHPStanServicesFactory.php # 82
- rules/nette-to-symfony/src/Rector/ClassMethod/RenameEventNamesInEventSubscriberRector.php # 39
- rules/type-declaration/src/Exception/ConflictingPriorityException.php # 18
2020-10-20 22:27:12 +02:00
- src/Console/Application.php # 54
2020-10-03 22:09:43 +02:00
- src/Exception/Application/FileProcessingException.php # 17
- src/Php/TypeAnalyzer.php # 49
2020-10-20 22:27:12 +02:00
- src/PhpParser/NodeTraverser/RectorNodeTraverser.php # 53
2020-10-07 16:20:53 +02:00
-
message : '#Use namespaceName on Class_ node#'
paths :
- packages/node-collector/src/NodeCollector/ParsedNodeCollector.php # 332
- packages/node-name-resolver/src/NodeNameResolver/ClassNameResolver.php # 45
- rules/coding-style/src/Rector/Use_/RemoveUnusedAliasRector.php # 294
- rules/doctrine-gedmo-to-knplabs/src/Rector/Class_/TranslationBehaviorRector.php # 247
- rules/generic/src/Rector/Class_/ActionInjectionToConstructorInjectionRector.php # 94
- rules/nette-to-symfony/src/Rector/Class_/NetteControlToSymfonyControllerRector.php # 114
- rules/php-spec-to-phpunit/src/Naming/PhpSpecRenaming.php # 107
- rules/php70/src/Rector/ClassMethod/Php4ConstructorRector.php # 120
- rules/symfony-code-quality/src/Rector/Class_/EventListenerToEventSubscriberRector.php # 247
- utils/doctrine-annotation-parser-syncer/src/Rector/Namespace_/RenameAnnotationReaderClassRector.php # 41
- utils/doctrine-annotation-parser-syncer/src/Rector/Namespace_/RenameDocParserClassRector.php # 41
2020-10-21 23:06:24 +02:00
- '#Parameter \#1 \$node of method Rector\\DeadCode\\Rector\\Plus\\RemoveDeadZeroAndOneOperationRector\:\:refactor\(\) expects PhpParser\\Node\\Expr\\AssignOp\\Div\|PhpParser\\Node\\Expr\\AssignOp\\Minus\|PhpParser\\Node\\Expr\\AssignOp\\Mul\|PhpParser\\Node\\Expr\\AssignOp\\Plus\|PhpParser\\Node\\Expr\\BinaryOp\\Div\|PhpParser\\Node\\Expr\\BinaryOp\\Minus\|PhpParser\\Node\\Expr\\BinaryOp\\Mul\|PhpParser\\Node\\Expr\\BinaryOp\\Plus, PhpParser\\Node\\Expr\\AssignOp\|PhpParser\\Node\\Expr\\BinaryOp given#'
2020-10-26 21:03:26 +07:00
2020-10-29 22:34:51 +01:00
-
message : '#Do not use trait#'
paths :
2020-10-31 22:39:09 +01:00
- packages/**/src/Behavior/**
2020-10-29 22:34:51 +01:00
- packages/better-php-doc-parser/src/Attributes/Attribute/AttributeTrait.php # 7
- packages/better-php-doc-parser/src/PartPhpDocTagPrinter/Behavior/ArrayPartPhpDocTagPrinterTrait.php # 14
- packages/better-php-doc-parser/src/PhpDocNode/PrintTagValueNodeTrait.php # 13
- packages/changes-reporting/src/Rector/AbstractRector/NotifyingRemovingNodeTrait.php # 17
- packages/post-rector/src/Rector/AbstractRector/NodeCommandersTrait.php # 31
- rules/doctrine/src/AbstractRector/DoctrineTrait.php # 13
2020-12-12 13:08:34 +01:00
- src/Rector/AbstractRector/*
2020-10-29 22:34:51 +01:00
-
2020-11-24 22:32:49 +07:00
message : '#Do not use scalar or array as constructor parameter\. Use "Symplify\\PackageBuilder\\Parameter\\ParameterProvider" service instead#'
2020-10-29 22:34:51 +01:00
paths :
2020-12-12 13:08:34 +01:00
# value objects
- packages/attribute-aware-php-doc/src/Ast/*
2020-10-29 22:34:51 +01:00
- packages/better-php-doc-parser/src/PhpDocInfo/PhpDocInfo.php # 108
- rules/coding-style/src/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector.php # 47
- rules/php70/src/EregToPcreTransformer.php # 66
- rules/phpstan/src/Type/AliasedObjectType.php # 22
- rules/phpstan/src/Type/AliasedObjectType.php # 24
- rules/phpstan/src/Type/ShortenedObjectType.php # 18
- rules/phpstan/src/Type/ShortenedObjectType.php # 20
- rules/restoration/src/Rector/Class_/RemoveUselessJustForSakeInterfaceRector.php # 42
- rules/type-declaration/src/Rector/FunctionLike/ReturnTypeDeclarationRector.php # 82
- src/PhpParser/Builder/UseBuilder.php # 17
- src/RectorDefinition/RectorDefinition.php # 31
2020-10-31 13:59:40 +01:00
- packages/testing/src/PHPUnit/Runnable/NodeVisitor/PrefixingClassLikeNamesNodeVisitor.php # 35
- packages/testing/src/PHPUnit/Runnable/NodeVisitor/PrefixingClassLikeNamesNodeVisitor.php # 36
2020-10-29 23:06:26 +01:00
-
message : '#Use local named constant instead of inline string for regex to explain meaning by constant name#'
paths :
2020-12-12 13:08:34 +01:00
- packages/better-php-doc-parser/src/PartPhpDocTagPrinter/Behavior/* # 30
2020-10-29 23:06:26 +01:00
- packages/better-php-doc-parser/src/PhpDocNode/PrintTagValueNodeTrait.php # 54
2020-10-30 12:58:35 +01:00
# allow in new <types> config
-
message : '#new <class\> is limited to 3 "new <class\>\(new <class\>\)\)" nesting to each other\. You have \d+ nesting#'
path : config/set/*
2020-10-30 14:25:24 +01:00
# nodes/stmts
- '#Parameter \#1 \$nodes of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findFirst\(\) expects array<PhpParser\\Node\>\|PhpParser\\Node, array<PhpParser\\Node\\Stmt\>\|null given#'
# finder type
- '#Method Rector\\SOLID\\Rector\\Assign\\MoveVariableDeclarationNearReferenceRector\:\:findFirstVariableUsageInScope\(\) should return PhpParser\\Node\\Expr\\Variable\|null but returns PhpParser\\Node\|null#'
2020-10-31 13:59:40 +01:00
2020-11-16 17:50:38 +00:00
- '#Class with base "NodeNameResolver" name is already used in "Symplify\\PHPStanRules\\PhpParser\\NodeNameResolver", "Rector\\NodeNameResolver\\NodeNameResolver"\. Use unique name to make classes easy to recognize#'
2020-10-31 13:59:40 +01:00
- '#Static property Rector\\Testing\\PHPUnit\\AbstractGenericRectorTestCase\:\:\$allRectorContainer \(Rector\\Naming\\Tests\\Rector\\Class_\\RenamePropertyToMatchTypeRector\\Source\\ContainerInterface\|Symfony\\Component\\DependencyInjection\\Container\|null\) does not accept Psr\\Container\\ContainerInterface#'
- '#Class with base "Application" name is already used in "(.*?)\\Symfony\\Component\\Console\\Application", "Symfony\\Component\\Console\\Application", "Rector\\Core\\Console\\Application"\. Use unique name to make classes easy to recognize#'
2020-10-31 17:20:30 +01:00
- '#Class with base "FileNode" name is already used in "PHPStan\\Node\\FileNode", "Rector\\Core\\PhpParser\\Node\\CustomNode\\FileNode"\. Use unique name to make classes easy to recognize#'
2020-11-05 04:32:49 +07:00
-
message : '#Node "errorsuppress" is fobidden to use#'
paths :
- tests/Issues/Issue4499/DoNotDuplicateCode/DoNotDuplicateCodeTest.php # 17
2020-11-12 20:47:25 +00:00
# trait in trait call
- '#Call to an undefined method Rector\\PostRector\\Rector\\AbstractPostRector\:\:isObjectType\(\)#'
2020-11-13 20:32:18 +00:00
- '#Parameter \#1 \$expr of class PhpParser\\Node\\Stmt\\Expression constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt given#'
2020-11-16 17:50:38 +00:00
-
2020-11-27 21:39:42 +01:00
message : '#Class cognitive complexity is \d+, keep it under \d+#'
2020-11-16 17:50:38 +00:00
paths :
- rules/php70/src/EregToPcreTransformer.php
- packages/node-collector/src/NodeCollector/NodeRepository.php
- packages/node-type-resolver/src/NodeTypeResolver.php
2020-11-27 21:39:42 +01:00
- rules/solid/src/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php
- src/Rector/AbstractRector.php
- rules/php80/src/Rector/If_/NullsafeOperatorRector.php
- rules/code-quality/src/Rector/For_/ForToForeachRector.php
- rules/coding-style/src/Rector/Use_/RemoveUnusedAliasRector.php
2020-11-16 17:50:38 +00:00
# symplify 9
- '#Use decoupled factory service to create "(.*?)" object#'
- '#Use "\$class\-\>namespaceName" instead of "\$class\-\>name" that only returns short class name#'
- '#Use another value object over array with string\-keys and objects, array<string, ValueObject\>#'
- '#SymfonyStyle usage is unneeded for only newline, write, and/or writeln, use PHP_EOL and concatenation instead#'
- '#Trait method "(.*?)" should not contain any logic, but only delegate to other class call#'
- '#Do not use factory/method call in constructor\. Put factory in config and get service with dependency injection#'
- '#Property with protected modifier is not allowed\. Use interface contract method instead#'
2020-11-16 23:32:24 +00:00
- '#Constant string value need to only have small letters, _, \-, \. and numbers#'
2020-11-16 17:50:38 +00:00
-
message : '#Use explicit names over dynamic ones#'
paths :
- packages/doctrine-annotation-generated/src/PhpDocNode/ConstantReferenceIdentifierRestorer.php # 61
- packages/doctrine-annotation-generated/src/PhpDocNode/ConstantReferenceIdentifierRestorer.php # 122
2020-11-20 00:26:04 +00:00
2020-11-23 17:40:29 +07:00
-
message : '#SymfonyStyle service is not needed for only newline and text echo\. Use PHP_EOL and concatenation instead#'
paths :
- packages/changes-reporting/src/Output/CheckstyleOutputFormatter.php # 15
2020-11-20 00:26:04 +00:00
- '#Instanceof between PhpParser\\Node\\Stmt and Rector\\Core\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace will always evaluate to false#'
2020-11-20 11:46:12 +00:00
- '#Class with base "Regex" name is already used in "MongoDB\\BSON\\Regex", "Symplify\\PHPStanRules\\ValueObject\\Regex"\. Use unique name to make classes easy to recognize#'
2020-11-24 21:30:17 +00:00
- '#Method Rector\\BetterPhpDocParser\\Tests\\PhpDocInfo\\PhpDocInfo\\PhpDocInfoTest\:\:createPhpDocInfoFromFile\(\) should return Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo but returns Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\|null#'
2020-12-01 02:09:50 +01:00
# skip for final method, that cannot be overriden without static reflection
- '#Class "Rector\\Nette\\Rector\\Class_\\MoveFinalGetUserToCheckRequirementsClassMethodRector" is missing @see annotation with test case class reference#'
2020-12-01 14:52:24 +01:00
# Symfony spl file info false positive
- '#Parameter \#2 \$mode of method Symfony\\Component\\Filesystem\\Filesystem\:\:chmod\(\) expects int, int\|false given#'
- '#Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int, array\)\: bool\)\|null, \(array&callable\(\)\: mixed\)\|\(callable\(\)\: mixed&object\)\|\(callable\(\)\ : mixed&string\) given#'
- '#Method Rector\\Privatization\\VisibilityGuard\\ClassMethodVisibilityGuard\:\:getParentClasses\(\) should return array<class\-string\> but returns array<int\|string, class\-string\|false\>#'
- '#Method Rector\\Privatization\\Rector\\Property\\PrivatizeFinalClassPropertyRector\:\:getParentClasses\(\) should return array<class\-string\> but returns array<int\|string, class\-string\|false\>#'
2020-12-05 00:22:12 +01:00
-
2020-12-10 00:40:38 +01:00
message : '#"(getComments|getDocComment|setDocComment)\(\)" call on "PhpParser\\Node" type is not allowed#'
2020-12-05 00:22:12 +01:00
paths :
# merging comments
2020-12-10 00:40:38 +01:00
- packages/better-php-doc-parser/tests/PhpDocInfo/PhpDocInfo/PhpDocInfoTest.php
2020-12-05 00:22:12 +01:00
- src/Rector/AbstractRector.php
- src/PhpParser/NodeTransformer.php
# playing around with doc block format
- rules/phpstan/src/Rector/Assign/PHPStormVarAnnotationRector.php
- rules/phpstan/src/Rector/Node/RemoveNonExistingVarAnnotationRector.php
2020-12-12 14:53:10 +01:00
- rules/code-quality/src/Rector/Return_/SimplifyUselessVariableRector.php
2020-12-05 00:22:12 +01:00
- rules/code-quality/src/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php
2020-12-12 14:53:10 +01:00
- rules/dead-code/src/Rector/Expression/RemoveDeadStmtRector.php
2020-12-10 00:40:38 +01:00
- rules/php-spec-to-phpunit/src/Rector/MethodCall/PhpSpecMocksToPHPUnitMocksRector.php
2020-12-05 00:22:12 +01:00
- packages/better-php-doc-parser/src/Comment/CommentsMerger.php
- packages/node-type-resolver/src/PhpDoc/NodeAnalyzer/DocBlockManipulator.php
- rules/coding-style/src/Node/DocAliasResolver.php
2020-12-10 00:40:38 +01:00
- packages/better-php-doc-parser/src/PhpDocInfo/PhpDocInfoFactory.php
2020-12-05 00:22:12 +01:00
- packages/better-php-doc-parser/tests/PhpDocParser/AbstractPhpDocInfoTest.php
2020-12-10 00:40:38 +01:00
- packages/better-php-doc-parser/tests/PhpDocInfo/PhpDocInfoPrinter/AbstractPhpDocInfoPrinterTest.php
2020-12-09 23:25:53 +01:00
2020-12-12 13:08:34 +01:00
-
message : '#Use value object over multi array assign#'
paths :
- packages/node-collector/src/NodeCollector/ParsedClassConstFetchNodeCollector.php
-
message : '#Do not use setter on a service#'
paths :
# setters for tests
- src/Configuration/Configuration.php
# data collector
- src/Configuration/RenamedClassesDataCollector.php
# custom internal rule
- packages/rector-generator/src/Rector/Closure/AddNewServiceToSymfonyPhpConfigRector.php
# hacking around closed design
- packages/better-php-doc-parser/src/PhpDocNodeFactory/ParamPhpDocNodeFactory.php
2020-12-12 14:53:10 +01:00
# known value
- '#Cannot call method (.*?)\(\) on DOMElement\|false#'
- '#Method (.*?) should return DOMElement but returns DOMElement\|false#'
- '#Method (.*?) should return DOMElement\|null but returns DOMElement\|false#'
2020-12-20 13:50:55 +01:00
# bug in simplify - @todo fix
- '#Parameter 2 should use "PhpParser\\Node\\Stmt\\Namespace_" type as the only type passed to this method#'
- '#Parameter 2 should use "Rector\\Core\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace" type as the only type passed to this method#'
- '#Content of method "(.*?)\(\)" is duplicated with method in "Rector\\Defluent\\ValueObject\\FirstAssignFluentCall" class\. Use unique content or abstract service instead#'
- '#Content of method "crateVariableFromNew\(\)" is duplicated with method in "Rector\\Defluent\\Rector\\MethodCall\\MethodCallOnSetterMethodCallToStandaloneAssignRector" class\. Use unique content or abstract service instead#'
# cache bug in PHPStan
- '#Content of method "isFoundCorrectNamespace\(\)" is duplicated with method in "Rector\\Utils\\ProjectValidator\\Command\\ValidateFixtureNamespaceCommand" class\. Use unique content or abstract service instead#'
-
message : '#Parameter 1 should use "PhpParser\\Node\\Stmt" type as the only type passed to this method#'
paths :
- rules/dead-code/src/Rector/Stmt/RemoveUnreachableStatementRector.php
-
message : '#Parameter 1 should use "PhpParser\\Node\\Identifier" type as the only type passed to this method#'
paths :
- rules/php80/src/Rector/If_/NullsafeOperatorRector.php