fixup! Add ScanFatalErrors command

This commit is contained in:
TomasVotruba 2019-12-24 16:10:57 +01:00
parent 3742dc4b44
commit 7e4c2887f9
9 changed files with 42 additions and 19 deletions

View File

@ -1,5 +0,0 @@
<?php declare(strict_types=1);
class First extends Test {
public function remove() {}
}

View File

@ -1,5 +0,0 @@
<?php declare(strict_types=1);
class Second extends Test {
public function remove() {}
}

View File

@ -1,5 +0,0 @@
<?php declare(strict_types=1);
class Test {
public function remove(): void {}
}

View File

@ -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",

View File

@ -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/*"

View File

@ -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();

View File

@ -0,0 +1,10 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Source\FatalErrors;
class First extends Test
{
public function remove()
{
}
}

View File

@ -0,0 +1,10 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Source\FatalErrors;
class Second extends Test
{
public function remove()
{
}
}

View File

@ -0,0 +1,10 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Source\FatalErrors;
class Test
{
public function remove(): void
{
}
}