Skip to content

Commit

Permalink
Display errors in a file (rectorphp#273)
Browse files Browse the repository at this point in the history
* cleanup bootstrpa config meta info, not useful

* misc
  • Loading branch information
TomasVotruba authored Jun 22, 2021
1 parent 725c7c9 commit 2120001
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 3 additions & 1 deletion config/set/downgrade-php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
declare(strict_types=1);

use Rector\Core\Configuration\Option;

use Rector\Core\ValueObject\PhpVersion;
use Rector\DowngradePhp73\Rector\FuncCall\DowngradeArrayKeyFirstLastRector;
use Rector\DowngradePhp73\Rector\FuncCall\DowngradeIsCountableRector;
use Rector\DowngradePhp73\Rector\FuncCall\DowngradeTrailingCommasInFunctionCallsRector;
use Rector\DowngradePhp73\Rector\FuncCall\SetCookieOptionsArrayToArgumentsRector;
use Rector\DowngradePhp73\Rector\List_\DowngradeListReferenceAssignmentRector;
Expand All @@ -21,5 +23,5 @@
$services->set(DowngradeTrailingCommasInFunctionCallsRector::class);
$services->set(DowngradeArrayKeyFirstLastRector::class);
$services->set(SetCookieOptionsArrayToArgumentsRector::class);
$services->set(\Rector\DowngradePhp73\Rector\FuncCall\DowngradeIsCountableRector::class);
$services->set(DowngradeIsCountableRector::class);
};
7 changes: 5 additions & 2 deletions config/set/downgrade-php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;

use Rector\DowngradePhp80\Rector\Catch_\DowngradeNonCapturingCatchesRector;
use Rector\DowngradePhp80\Rector\Class_\DowngradeAttributeToAnnotationRector;
use Rector\DowngradePhp80\Rector\Class_\DowngradePropertyPromotionRector;
Expand All @@ -12,6 +13,8 @@
use Rector\DowngradePhp80\Rector\ClassMethod\DowngradeTrailingCommasInParamUseRector;
use Rector\DowngradePhp80\Rector\Expression\DowngradeMatchToSwitchRector;
use Rector\DowngradePhp80\Rector\FuncCall\DowngradeStrContainsRector;
use Rector\DowngradePhp80\Rector\FuncCall\DowngradeStrEndsWithRector;
use Rector\DowngradePhp80\Rector\FuncCall\DowngradeStrStartsWithRector;
use Rector\DowngradePhp80\Rector\FunctionLike\DowngradeMixedTypeDeclarationRector;
use Rector\DowngradePhp80\Rector\FunctionLike\DowngradeUnionTypeDeclarationRector;
use Rector\DowngradePhp80\Rector\MethodCall\DowngradeNamedArgumentRector;
Expand Down Expand Up @@ -53,7 +56,7 @@
$services->set(DowngradeClassOnObjectToGetClassRector::class);
$services->set(DowngradeNullsafeToTernaryOperatorRector::class);
$services->set(DowngradeTrailingCommasInParamUseRector::class);
$services->set(\Rector\DowngradePhp80\Rector\FuncCall\DowngradeStrStartsWithRector::class);
$services->set(\Rector\DowngradePhp80\Rector\FuncCall\DowngradeStrEndsWithRector::class);
$services->set(DowngradeStrStartsWithRector::class);
$services->set(DowngradeStrEndsWithRector::class);
$services->set(DowngradeNamedArgumentRector::class);
};
2 changes: 1 addition & 1 deletion config/set/php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
]]);
$services->set(OptionalParametersAfterRequiredRector::class);

$services->set(Rector\Arguments\Rector\FuncCall\FunctionArgumentDefaultValueReplacerRector::class)
$services->set(FunctionArgumentDefaultValueReplacerRector::class)
->call('configure', [[
FunctionArgumentDefaultValueReplacerRector::REPLACED_ARGUMENTS => ValueObjectInliner::inline([
new ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'gte', 'ge'),
Expand Down
8 changes: 0 additions & 8 deletions src/Application/FileProcessor/PhpFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,6 @@ private function advance(File $file, string $phase, Configuration $configuration

private function printFileErrors(File $file): void
{
if (! $this->symfonyStyle->isVerbose()) {
return;
}

if (! $file->hasErrors()) {
return;
}

foreach ($file->getErrors() as $rectorError) {
$this->symfonyStyle->error($rectorError->getMessage());
}
Expand Down

0 comments on commit 2120001

Please sign in to comment.