Fix ci of missing PHPStan extension types (#43)

This commit is contained in:
Tomas Votruba 2021-05-15 15:18:20 +01:00 committed by GitHub
parent e7732fbebe
commit 8ce853d8ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 9 deletions

View File

@ -85,9 +85,7 @@
"Rector\\RuleDocGenerator\\": "utils/rule-doc-generator/src"
},
"classmap": [
"stubs/Annotations",
"stubs/Nette",
"stubs/MyCLabs",
"stubs",
"rules-tests/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector/Expected",
"rules-tests/Autodiscovery/Rector/Interface_/MoveInterfacesToContractNamespaceDirectoryRector/Expected",
"rules-tests/CodingStyle/Rector/Namespace_/ImportFullyQualifiedNamesRector/Source",

View File

@ -0,0 +1,37 @@
# Packages CI Status
## Nette
* https://github.com/rectorphp/rector-nette
* ![](https://github.com/rectorphp/rector-nette/actions/workflows/tests.yaml/badge.svg)
* ![](https://github.com/rectorphp/rector-nette/actions/workflows/code_analysis.yaml/badge.svg)
## Symfony
* https://github.com/rectorphp/rector-symfony
* ![](https://github.com/rectorphp/rector-symfony/actions/workflows/tests.yaml/badge.svg)
* ![](https://github.com/rectorphp/rector-symfony/actions/workflows/code_analysis.yaml/badge.svg)
## Laravel
* https://github.com/rectorphp/rector-laravel
* ![](https://github.com/rectorphp/rector-laravel/actions/workflows/tests.yaml/badge.svg)
* ![](https://github.com/rectorphp/rector-laravel/actions/workflows/code_analysis.yaml/badge.svg)
## PHPUnit
* https://github.com/rectorphp/rector-phpunit
* ![](https://github.com/rectorphp/rector-phpunit/actions/workflows/tests.yaml/badge.svg)
* ![](https://github.com/rectorphp/rector-phpunit/actions/workflows/code_analysis.yaml/badge.svg)
## CakePHP
* https://github.com/rectorphp/rector-cakephp
* ![](https://github.com/rectorphp/rector-cakephp/actions/workflows/tests.yaml/badge.svg)
* ![](https://github.com/rectorphp/rector-cakephp/actions/workflows/code_analysis.yaml/badge.svg)
## Nette to Symfony
* https://github.com/rectorphp/rector-nette-to-symfony
* ![](https://github.com/rectorphp/rector-nette-to-symfony/actions/workflows/tests.yaml/badge.svg)
* ![](https://github.com/rectorphp/rector-nette-to-symfony/actions/workflows/code_analysis.yaml/badge.svg)

View File

@ -31,6 +31,7 @@ final class PHPStanServicesFactory
$containerFactory = new ContainerFactory(getcwd());
$additionalConfigFiles = [];
$additionalConfigFiles[] = $parameterProvider->provideStringParameter(Option::PHPSTAN_FOR_RECTOR_PATH);
$additionalConfigFiles[] = __DIR__ . '/../../../config/phpstan/static-reflection.neon';
$additionalConfigFiles[] = __DIR__ . '/../../../config/phpstan/better-infer.neon';

View File

@ -12,13 +12,11 @@
<directory>rules-tests</directory>
<directory>packages-tests</directory>
<directory>utils/*/tests</directory>
<exclude>rules-tests/NetteTesterToPHPUnit/Rector/RenameTesterTestToPHPUnitToTestFileRector/Source/*</exclude>
</testsuite>
</testsuites>
<php>
<ini name="memory_limit" value="-1" />
<const name="RECTOR_REPOSITORY" value="true"/>
<env name="XDEBUG_MODE" value="coverage"/>
<env name="KERNEL_CACHE_DIRECTORY" value="tmp/rector/cache"/>
</php>

View File

@ -10,6 +10,7 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersionFeature::UNION_TYPES - 1);
$parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, __DIR__ . '/../../../../../../phpstan-for-rector.neon');
$services = $containerConfigurator->services();
$services->set(ReturnTypeDeclarationRector::class);

View File

@ -232,16 +232,16 @@ final class PhpFileProcessor implements FileProcessorInterface
private function printFileErrors(File $file): void
{
if(!$this->symfonyStyle->isVerbose()) {
if (! $this->symfonyStyle->isVerbose()) {
return;
}
if(!$file->hasErrors()) {
if (! $file->hasErrors()) {
return;
}
foreach ($file->getErrors() as $error) {
$this->symfonyStyle->error($error->getMessage());
foreach ($file->getErrors() as $rectorError) {
$this->symfonyStyle->error($rectorError->getMessage());
}
}
}