Skip to content

Commit

Permalink
[automated] Apply Coding Standard (#3713)
Browse files Browse the repository at this point in the history
* [automated] Apply Coding Standard

* [ci-review] Rector Rectify

---------

Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
Co-authored-by: GitHub Action <actions@github.com>
  • Loading branch information
3 people committed Apr 30, 2023
1 parent d7a738c commit 08d93e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private function resolveUnionTypes(PhpParserUnionType $phpParserUnionType, int $

$phpParserUnionType->types = array_filter(
$phpParserUnionType->types,
static fn(Node $node): bool => ! $node instanceof Identifier || $node->toString() !== 'false'
static fn (Node $node): bool => ! $node instanceof Identifier || $node->toString() !== 'false'
);
$phpParserUnionType->types = array_values($phpParserUnionType->types);

Expand Down
10 changes: 5 additions & 5 deletions rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\Renaming\Rector\PropertyFetch;

use PHPStan\Type\Type;
use PhpParser\Node;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Identifier;
Expand All @@ -14,6 +13,7 @@
use PhpParser\Node\VarLikeIdentifier;
use PHPStan\Type\ObjectType;
use PHPStan\Type\ThisType;
use PHPStan\Type\Type;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\Core\Rector\AbstractRector;
use Rector\Renaming\ValueObject\RenameProperty;
Expand Down Expand Up @@ -125,16 +125,16 @@ private function processFromPropertyFetch(PropertyFetch $propertyFetch): ?Proper
if (! $this->isObjectType($propertyFetch->var, $renamedProperty->getObjectType())) {
continue;
}

if ($class instanceof ClassLike) {
if (! $nodeVarType instanceof Type) {
$nodeVarType = $this->nodeTypeResolver->getType($propertyFetch->var);
}

if ($nodeVarType instanceof ThisType ) {
if ($nodeVarType instanceof ThisType) {
$this->renameProperty($class, $renamedProperty);
}
}
}
}

$propertyFetch->name = new Identifier($renamedProperty->getNewProperty());
return $propertyFetch;
Expand Down
1 change: 1 addition & 0 deletions src/Application/ApplicationFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function run(Configuration $configuration, InputInterface $input): array
if ($configuration->shouldShowDiffs()) {
$this->fileDiffFileDecorator->decorate($files);
}

$this->printFiles($files, $configuration);
}

Expand Down

0 comments on commit 08d93e0

Please sign in to comment.