Skip to content

Commit

Permalink
[automated] Apply Coding Standard (#3550)
Browse files Browse the repository at this point in the history
Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
  • Loading branch information
TomasVotruba and TomasVotruba committed Apr 2, 2023
1 parent 1f8d359 commit 58f00bf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion rules/CodeQuality/Rector/Switch_/SwitchTrueToIfRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Rector\CodeQuality\Rector\Switch_;

use PhpParser\Node\Expr;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Case_;
use PhpParser\Node\Stmt\If_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ public function refactor(Node $node): ?Node

private function processRemoveSameLineComment(Class_ $class, Property $property, int $key): void
{
if (!isset($class->stmts[$key + 1])) {
if (! isset($class->stmts[$key + 1])) {
return;
}

if (!$class->stmts[$key + 1] instanceof Nop) {
if (! $class->stmts[$key + 1] instanceof Nop) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ public function __construct(
) {
}

private function resolveCastType(Cast $cast): ?Type
{
$type = $this->nodeTypeResolver->getType($cast);
if ($this->isScalarType($type)) {
return $type;
}

return null;
}

public function matchStrictScalarExpr(Expr $expr): ?Type
{
if ($expr instanceof Concat) {
Expand Down Expand Up @@ -90,6 +80,16 @@ public function matchStrictScalarExpr(Expr $expr): ?Type
return $this->resolveIndirectReturnType($expr);
}

private function resolveCastType(Cast $cast): ?Type
{
$type = $this->nodeTypeResolver->getType($cast);
if ($this->isScalarType($type)) {
return $type;
}

return null;
}

private function resolveIndirectReturnType(Expr $expr): ?Type
{
if (! $expr instanceof Variable && ! $expr instanceof PropertyFetch && ! $expr instanceof StaticPropertyFetch) {
Expand Down

0 comments on commit 58f00bf

Please sign in to comment.