Skip to content

Commit dbafa78

Browse files
committed
Revert "cleanup errors (rectorphp#7826)"
This reverts commit edc3ee2.
1 parent 7d06001 commit dbafa78

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"rector/type-perfect": "^2.1.2",
5757
"shipmonk/composer-dependency-analyser": "^1.8",
5858
"symplify/phpstan-extensions": "^12.0.2",
59-
"symplify/phpstan-rules": "^14.9.11",
59+
"symplify/phpstan-rules": "^14.9.4",
6060
"symplify/vendor-patches": "^11.5",
6161
"tomasvotruba/class-leak": "^2.1",
6262
"tomasvotruba/unused-public": "^2.2",

phpstan.neon

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ includes:
55
parameters:
66
level: 8
77

8-
# reportUnmatchedIgnoredErrors: false
9-
8+
reportUnmatchedIgnoredErrors: false
109
errorFormat: symplify
1110

1211
# see https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases
@@ -372,6 +371,11 @@ parameters:
372371

373372
- '#Method Rector\\Utils\\Rector\\RemoveRefactorDuplicatedNodeInstanceCheckRector\:\:getInstanceofNodeClass\(\) should return class\-string<PhpParser\\Node>\|null but returns class\-string#'
374373

374+
# helper classes for bin script
375+
-
376+
path: scripts
377+
identifier: symplify.multipleClassLikeInFile
378+
375379
# copied from /vendor, to keep as original as possible
376380
-
377381
identifier: missingType.iterableValue
@@ -402,6 +406,9 @@ parameters:
402406
- rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php
403407
- rules/DeadCode/Rector/If_/UnwrapFutureCompatibleIfPhpVersionRector.php
404408

409+
# condition check, just to be sure
410+
- '#Method Rector\\Rector\\AbstractRector\:\:enterNode\(\) never returns 3 so it can be removed from the return type#'
411+
405412
# deprecated
406413
-
407414
identifier: public.method.unused
@@ -410,7 +417,14 @@ parameters:
410417
- rules/CodeQuality/ValueObject/KeyAndExpr.php
411418
-
412419
identifier: symplify.forbiddenExtendOfNonAbstractClass
413-
path: rules/Php81/Rector/Array_/FirstClassCallableRector.php
420+
path: src/PhpParser/Node/FileNode.php
421+
-
422+
identifier: method.deprecatedClass
423+
path: src/PhpParser/Node/FileNode.php
424+
425+
-
426+
identifier: class.extendsDeprecatedClass
427+
path: src/PhpParser/Node/FileNode.php
414428

415429
-
416430
identifier: public.classConstant.unused
@@ -428,23 +442,38 @@ parameters:
428442
- '#Rule Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector must implements Rector\\VersionBonding\\Contract\\MinPhpVersionInterface#'
429443
- '#Register "Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector" service to "php81\.php" config set#'
430444
- '#Class "Rector\\CodingStyle\\Rector\\String_\\SymplifyQuoteEscapeRector" is missing @see annotation with test case class reference#'
445+
- '#Access to constant on deprecated class Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector#'
431446

432447
# BC layer for FileWithoutNamespace node
448+
- message: '#Use @see \\Rector\\PhpParser\\Node\\FileNode instead#'
449+
- '#BC layer for FileNode and FileWithoutNamespace compat, use FileNode instead#'
433450
-
434451
path: src/PhpParser/Node/CustomNode/FileWithoutNamespace.php
435452
identifier: symplify.forbiddenExtendOfNonAbstractClass
453+
-
454+
message: '#Only abstract classes can be extended#'
455+
path: rules/Php81/Rector/Array_/FirstClassCallableRector.php
436456

457+
- '#Method Rector\\Tests\\Issues\\FileWithoutNamespaceCompat\\Rector\\SubscribedToFileWithoutNamespaceRector\:\:refactor\(\) should return Rector\\PhpParser\\Node\\FileNode but returns Rector\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace#'
458+
459+
# BC layer for FileWithoutNamespace node
437460
- message: '#Use @see \\Rector\\PhpParser\\Node\\FileNode instead#'
461+
- '#Class Rector\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace extends final class Rector\\PhpParser\\Node\\FileNode#'
462+
-
463+
path: src/PhpParser/Node/CustomNode/FileWithoutNamespace.php
464+
identifier: symplify.forbiddenExtendOfNonAbstractClass
438465

439466
# false positive
440467
-
441468
identifier: phpstanApi.varTagAssumption
442469
path: rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php
443470

444-
# @todo fix in phpstan-rules
471+
# bug, fix in symplify/phpstan-rules
445472
-
446473
identifier: symplify.noMissnamedDocTag
447-
path: rules/TypeDeclarationDocblocks/TypeResolver/ConstantArrayTypeGeneralizer.php
474+
paths:
475+
- rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php
476+
- rules/TypeDeclarationDocblocks/TypeResolver/ConstantArrayTypeGeneralizer.php
448477

449478
-
450479
identifier: typePerfect.narrowReturnObjectType

rules/TypeDeclarationDocblocks/TypeResolver/ConstantArrayTypeGeneralizer.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
final class ConstantArrayTypeGeneralizer
1818
{
1919
/**
20-
* @var int
21-
*
2220
* Using 10-level array @return docblocks makes code very hard to read,
2321
* lets limit it to reasonable level
2422
*/

0 commit comments

Comments
 (0)