Skip to content

Commit 09bd026

Browse files
committed
keep file without namespace implementing interface to alling with other nodes
1 parent 24977b2 commit 09bd026

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

phpstan.neon

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ parameters:
3434
scanDirectories:
3535
- stubs
3636

37-
# scanFiles:
38-
# - src/Contract/PhpParser/Node/StmtsAwareInterface.php
39-
4037
excludePaths:
4138
- '*tests/*/Fixture/*'
4239
- '*tests/*/Fixture*'
@@ -211,8 +208,6 @@ parameters:
211208
message: '#Function "(class_exists|interface_exists)\(\)" cannot be used/left in the code\: use ReflectionProvider\->has\*\(\) instead#'
212209
path: src/Skipper/SkipCriteriaResolver/SkippedClassResolver.php
213210

214-
# - '#(.*?)\\Contract\\PhpParser\\Node\\StmtsAwareInterface\:\:\$stmts#'
215-
216211
# dev rule
217212
- '#Class "Rector\\Utils\\Rector\\MoveAbstractRectorToChildrenRector" is missing @see annotation with test case class reference#'
218213

@@ -273,6 +268,7 @@ parameters:
273268
-
274269
path: src/Configuration/RectorConfigBuilder.php
275270
identifier: classConstant.deprecatedInterface
271+
- '#Class Rector\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace implements deprecated interface Rector\\Contract\\PhpParser\\Node\\StmtsAwareInterface#'
276272

277273
# allowed internally only
278274
-

src/PhpParser/Node/CustomNode/FileWithoutNamespace.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
namespace Rector\PhpParser\Node\CustomNode;
66

77
use PhpParser\Node\Stmt;
8+
use Rector\Contract\PhpParser\Node\StmtsAwareInterface;
89

910
/**
1011
* Inspired by https://github.com/phpstan/phpstan-src/commit/ed81c3ad0b9877e6122c79b4afda9d10f3994092
1112
*/
12-
final class FileWithoutNamespace extends Stmt
13+
final class FileWithoutNamespace extends Stmt implements StmtsAwareInterface
1314
{
1415
/**
1516
* @param Stmt[] $stmts

0 commit comments

Comments
 (0)