mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-21 16:02:23 +02:00
fixup! Add ScanFatalErrors command
This commit is contained in:
parent
3742dc4b44
commit
7e4c2887f9
@ -1,5 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
class First extends Test {
|
||||
public function remove() {}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
class Second extends Test {
|
||||
public function remove() {}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
class Test {
|
||||
public function remove(): void {}
|
||||
}
|
@ -174,8 +174,7 @@
|
||||
"tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/Source",
|
||||
"tests/Issues/Issue1243/Source",
|
||||
"packages/Autodiscovery/tests/Rector/FileSystem/MoveInterfacesToContractNamespaceDirectoryRector/Expected",
|
||||
"packages/Autodiscovery/tests/Rector/FileSystem/MoveServicesBySuffixToDirectoryRector/Expected",
|
||||
"abz"
|
||||
"packages/Autodiscovery/tests/Rector/FileSystem/MoveServicesBySuffixToDirectoryRector/Expected"
|
||||
],
|
||||
"files": [
|
||||
"packages/DeadCode/tests/Rector/MethodCall/RemoveDefaultArgumentValueRector/Source/UserDefined.php",
|
||||
|
@ -5,7 +5,6 @@ parameters:
|
||||
exclude_paths:
|
||||
- "/Fixture/"
|
||||
- "/Expected/"
|
||||
- "/Source/"
|
||||
- "packages/Symfony/src/Bridge/DefaultAnalyzedSymfonyApplicationContainer.php"
|
||||
- "src/Testing/PHPUnit/AbstractRectorTestCase.php"
|
||||
- "packages/Php/tests/Rector/Name/ReservedObjectRector/*"
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Rector\Scan;
|
||||
|
||||
use Rector\FileSystem\FilesFinder;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
final class ErrorScanner
|
||||
@ -19,9 +20,15 @@ final class ErrorScanner
|
||||
*/
|
||||
private $filesFinder;
|
||||
|
||||
public function __construct(FilesFinder $filesFinder)
|
||||
/**
|
||||
* @var SymfonyStyle
|
||||
*/
|
||||
private $symfonyStyle;
|
||||
|
||||
public function __construct(FilesFinder $filesFinder, SymfonyStyle $symfonyStyle)
|
||||
{
|
||||
$this->filesFinder = $filesFinder;
|
||||
$this->symfonyStyle = $symfonyStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -41,6 +48,9 @@ final class ErrorScanner
|
||||
$currentCommandLine .= sprintf('include "%s";', $fileInfo->getRelativeFilePathFromCwd());
|
||||
|
||||
$currentCommandLine = sprintf("php -r '%s'", $currentCommandLine);
|
||||
|
||||
$this->symfonyStyle->note('Running PHP in sub-process: ' . $currentCommandLine);
|
||||
|
||||
$process = Process::fromShellCommandline($currentCommandLine);
|
||||
$process->run();
|
||||
|
||||
|
10
tests/Source/FatalErrors/First.php
Normal file
10
tests/Source/FatalErrors/First.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Tests\Source\FatalErrors;
|
||||
|
||||
class First extends Test
|
||||
{
|
||||
public function remove()
|
||||
{
|
||||
}
|
||||
}
|
10
tests/Source/FatalErrors/Second.php
Normal file
10
tests/Source/FatalErrors/Second.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Tests\Source\FatalErrors;
|
||||
|
||||
class Second extends Test
|
||||
{
|
||||
public function remove()
|
||||
{
|
||||
}
|
||||
}
|
10
tests/Source/FatalErrors/Test.php
Normal file
10
tests/Source/FatalErrors/Test.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Tests\Source\FatalErrors;
|
||||
|
||||
class Test
|
||||
{
|
||||
public function remove(): void
|
||||
{
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user