Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions phpstan-deprecated.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# deprecated code kept temporarily, ignores to drop once the deprecated API is removed
parameters:
ignoreErrors:
# deprecated, to be removed
-
message: '#^Unused Rector\\Set\\Contract\\SetInterface\:\:(.*?)$#'
identifier: shipmonk.deadMethod
path: src/Set/Contract/SetInterface.php

# the deprecated set objects are still resolved internally, until every extension bonds its rules
-
message: '#deprecated (class|interface) Rector\\(Set|Bridge)\\#'
path: src/Configuration/RectorConfigBuilder.php

# EARLY_RETURN set is deprecated (empty, merged into code-quality), still mapped internally until removed
-
identifier: classConstant.deprecated
paths:
- src/Configuration/RectorConfigBuilder.php

# the deprecated SetList::PHP_* constants are still resolved internally by the level sets and their tests
-
identifier: classConstant.deprecated
paths:
- config/set/level
- tests/Bridge/SetRectorsResolverTest.php

# the deprecated github/gitlab output formatters are still tested until removed in next minor version
-
identifier: new.deprecatedClass
path: tests/ChangesReporting/Output/GitHubOutputFormatterTest.php

-
identifier: method.deprecatedClass
path: tests/ChangesReporting/Output/GitHubOutputFormatterTest.php
35 changes: 2 additions & 33 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
includes:
- vendor/symplify/phpstan-rules/config/rector-rules.neon
- phpstan-deprecated.neon

rules:
- Rector\Utils\PHPStan\Rule\RegisterRelatedPolyfillRectorRule
Expand Down Expand Up @@ -56,6 +57,7 @@ parameters:
phpunit: true
mocks: true
ctor: true
modern: true

# see https://github.com/TomasVotruba/type-coverage
type_coverage:
Expand All @@ -81,39 +83,6 @@ parameters:
identifier: shipmonk.deadMethod
path: src/PhpParser/Printer/BetterStandardPrinter.php

# deprecated, to be removed
-
message: '#^Unused Rector\\Set\\Contract\\SetInterface\:\:(.*?)$#'
identifier: shipmonk.deadMethod
path: src/Set/Contract/SetInterface.php

# the deprecated set objects are still resolved internally, until every extension bonds its rules
-
message: '#deprecated (class|interface) Rector\\(Set|Bridge)\\#'
path: src/Configuration/RectorConfigBuilder.php

# EARLY_RETURN set is deprecated (empty, merged into code-quality), still mapped internally until removed
-
identifier: classConstant.deprecated
paths:
- src/Configuration/RectorConfigBuilder.php

# the deprecated SetList::PHP_* constants are still resolved internally by the level sets and their tests
-
identifier: classConstant.deprecated
paths:
- config/set/level
- tests/Bridge/SetRectorsResolverTest.php

# the deprecated github/gitlab output formatters are still tested until removed in next minor version
-
identifier: new.deprecatedClass
path: tests/ChangesReporting/Output/GitHubOutputFormatterTest.php

-
identifier: method.deprecatedClass
path: tests/ChangesReporting/Output/GitHubOutputFormatterTest.php

-
identifier: argument.templateType
path: rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeForArrayReduceRector.php
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Tests\Issues\IndentationCrash\PrintCrash;
namespace Rector\Tests\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector\Fixture;

final class WithInterpolatedStringPart
{
Expand All @@ -11,4 +11,3 @@ final class WithInterpolatedStringPart
}
}
}

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace Rector\Tests\Issues\AliasedImportDouble\Fixture;
namespace Rector\Tests\Renaming\Rector\Name\RenameClassRector\Fixture;

use Symfony\Component\Validator\Constraints as Assert;

final class CallbackWithCurlyBraces
{
/**
* @Assert\Choice(callback={"Some\Random\Class_", "getChoices"})
* @Assert\Choice(callback={"MyNamespace\MylegacyClass", "getChoices"})
*/
private $attribute;
}
Expand All @@ -16,14 +16,14 @@ final class CallbackWithCurlyBraces
-----
<?php

namespace Rector\Tests\Issues\AliasedImportDouble\Fixture;
namespace Rector\Tests\Renaming\Rector\Name\RenameClassRector\Fixture;

use Symfony\Component\Validator\Constraints as Assert;

final class CallbackWithCurlyBraces
{
/**
* @Assert\Choice(callback={"Some\Other\Random\Class_", "getChoices"})
* @Assert\Choice(callback={"MyNewNamespace\MyNewClass", "getChoices"})
*/
private $attribute;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Tests\Issues\AliasedImportDouble\Fixture;
namespace Rector\Tests\Renaming\Rector\Name\RenameClassRector\Fixture;

use Symfony\Component\Validator\Constraints as Assert;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function refactor(Node $node): ?Node
$this->hasChanged = false;

// skip class without parents/interfaces, there is no param type to mimic
if ($node instanceof Class_ && !$node->extends instanceof Name && $node->implements === []) {
if ($node instanceof Class_ && ! $node->extends instanceof Name && $node->implements === []) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getNodeTypes(): array
public function refactor(Node $node): ?Node
{
// entity type is resolved from the @extends docblock, bail early when absent
if (!$node->getDocComment() instanceof Doc) {
if (! $node->getDocComment() instanceof Doc) {
return null;
}

Expand Down
28 changes: 0 additions & 28 deletions tests/Issues/PrintCrash/PrintCrashTest.php

This file was deleted.

10 changes: 0 additions & 10 deletions tests/Issues/PrintCrash/config/configured_rule.php

This file was deleted.

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions tests/Issues/TestDocAnnotation/Fixture/fixture.php.inc

This file was deleted.

33 changes: 0 additions & 33 deletions tests/Issues/TestDocAnnotation/Fixture/multi_double_colon.php.inc

This file was deleted.

28 changes: 0 additions & 28 deletions tests/Issues/TestDocAnnotation/TestDocAnnotationTest.php

This file was deleted.

13 changes: 0 additions & 13 deletions tests/Issues/TestDocAnnotation/config/configured_rule.php

This file was deleted.

31 changes: 0 additions & 31 deletions tests/Issues/TestWithAttribute/Fixture/keep_string_as_is.php.inc

This file was deleted.

Loading
Loading