Skip to content

Commit fbd4e4c

Browse files
committed
print stmts with false
1 parent 65c921e commit fbd4e4c

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

rules/TypeDeclaration/Rector/StmtsAwareInterface/DeclareStrictTypesRector.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Rector\TypeDeclaration\Rector\StmtsAwareInterface;
66

77
use PhpParser\Node;
8-
use PhpParser\Node\Stmt;
98
use PhpParser\Node\Stmt\Nop;
109
use Rector\Contract\Rector\HTMLAverseRectorInterface;
1110
use Rector\PhpParser\Node\FileNode;

src/PhpParser/Node/CustomNode/FileWithoutNamespace.php

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

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

1011
/**
@@ -13,7 +14,7 @@
1314
*
1415
* Inspired by https://github.com/phpstan/phpstan-src/commit/ed81c3ad0b9877e6122c79b4afda9d10f3994092
1516
*/
16-
final class FileWithoutNamespace extends FileNode
17+
final class FileWithoutNamespace extends FileNode implements StmtsAwareInterface
1718
{
1819
/**
1920
* @param Stmt[] $stmts

src/PhpParser/Printer/BetterStandardPrinter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ protected function p(
159159

160160
protected function pStmt_FileNode(FileNode $fileNode): string
161161
{
162-
return $this->pStmts($fileNode->stmts, true);
162+
return $this->pStmts($fileNode->stmts);
163163
}
164164

165165
protected function pExpr_ArrowFunction(ArrowFunction $arrowFunction, int $precedence, int $lhsPrecedence): string

src/Reporting/DeprecatedRulesReporter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@
1111
use Rector\Contract\Rector\RectorInterface;
1212
use Rector\PhpParser\Enum\NodeGroup;
1313
<<<<<<< HEAD
14+
<<<<<<< HEAD
1415
use Rector\PhpParserNode\FileNode;
1516
=======
1617
<<<<<<< HEAD
1718
>>>>>>> 6bcee47e76 (warn about deprecated type)
1819
use ReflectionMethod;
1920
=======
21+
=======
22+
>>>>>>> 00c8276150 (print stmts with false)
2023
use Rector\PhpParser\Node\CustomNode\FileWithoutNamespace;
2124
use Rector\PhpParser\Node\FileNode;
22-
>>>>>>> 77056cdc84 (warn about deprecated type)
25+
use ReflectionMethod;
2326
use Symfony\Component\Console\Style\SymfonyStyle;
2427

2528
final readonly class DeprecatedRulesReporter

src/ValueObject/Application/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,6 @@ public function getFileNode(): ?FileNode
221221

222222
public function hasShebang(): bool
223223
{
224-
return str_starts_with($this->getFileContent(), '#!');
224+
return str_starts_with($this->fileContent, '#!');
225225
}
226226
}

0 commit comments

Comments
 (0)