Skip to content

Commit

Permalink
Fix ci of missing PHPStan extension types (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 15, 2021
1 parent e7732fb commit 8ce853d
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 9 deletions.
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
37 changes: 37 additions & 0 deletions dev-docs/packages_ci_status.md
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct(ParameterProvider $parameterProvider)
$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';
Expand Down
2 changes: 0 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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);
Expand Down
8 changes: 4 additions & 4 deletions src/Application/FileProcessor/PhpFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,16 @@ private function advance(File $file, string $phase): void

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

0 comments on commit 8ce853d

Please sign in to comment.