Skip to content

Commit

Permalink
Apply Rector + coding standard (#3745)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 6, 2023
1 parent 575e799 commit d13351c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion packages/NodeTypeResolver/NodeTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\Ternary;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\NullableType;
Expand Down
2 changes: 1 addition & 1 deletion packages/Parallel/WorkerRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private function collectSystemErrors(array $systemErrors, Throwable $throwable,

private function invalidateFile(?File $file): void
{
if (!$file instanceof File) {
if (! $file instanceof File) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ private function shouldSkip(Foreach_ $foreach): bool
}

$type = $this->getType($foreach->expr);
return ! $type->isArray()->yes();
return ! $type->isArray()
->yes();
}

private function shouldSkipForeachKeyUsage(If_ $if, Expr $expr): bool
Expand Down
4 changes: 2 additions & 2 deletions rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ private function shouldSkipFunctionReflection(MethodReflection|FunctionReflectio
}

if ($reflection instanceof MethodReflection) {
$class = $reflection->getDeclaringClass();
$fileName = (string) $class->getFileName();
$classReflection = $reflection->getDeclaringClass();
$fileName = (string) $classReflection->getFileName();
if (str_contains($fileName, 'phpstan.phar')) {
return \true;
}
Expand Down
10 changes: 2 additions & 8 deletions rules/Restoration/Rector/Class_/RemoveFinalFromEntityRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@ final class RemoveFinalFromEntityRector extends AbstractRector
/**
* @var string[]
*/
private const ALLOWED_ANNOTATIONS = [
'Doctrine\ORM\Mapping\Entity',
'Doctrine\ORM\Mapping\Embeddable'
];
private const ALLOWED_ANNOTATIONS = ['Doctrine\ORM\Mapping\Entity', 'Doctrine\ORM\Mapping\Embeddable'];

/**
* @var string[]
*/
private const ALLOWED_ATTRIBUTES = [
'Doctrine\ORM\Mapping\Entity',
'Doctrine\ORM\Mapping\Embeddable'
];
private const ALLOWED_ATTRIBUTES = ['Doctrine\ORM\Mapping\Entity', 'Doctrine\ORM\Mapping\Embeddable'];

public function __construct(
private readonly VisibilityManipulator $visibilityManipulator,
Expand Down

0 comments on commit d13351c

Please sign in to comment.