Skip to content

Commit

Permalink
[automated] Apply Coding Standard (#5171)
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 Oct 15, 2023
1 parent da2dd66 commit 9cf016c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion rules/DeadCode/Rector/Cast/RecastingRemovalRector.php
Expand Up @@ -24,7 +24,6 @@
use PHPStan\Type\ObjectType;
use PHPStan\Type\StringType;
use PHPStan\Type\Type;
use PHPStan\Type\UnionType;
use Rector\Core\NodeAnalyzer\ExprAnalyzer;
use Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer;
use Rector\Core\Rector\AbstractRector;
Expand Down
Expand Up @@ -206,7 +206,7 @@ private function shouldSkipForeachExpr(Expr $foreachExpr, Scope $scope): bool
if ($foreachExpr instanceof Expr\ArrayDimFetch && $foreachExpr->dim !== null) {
$exprType = $this->nodeTypeResolver->getNativeType($foreachExpr->var);
$dimType = $this->nodeTypeResolver->getNativeType($foreachExpr->dim);
if (!$exprType->hasOffsetValueType($dimType)->yes()) {
if (! $exprType->hasOffsetValueType($dimType)->yes()) {
return true;
}
}
Expand All @@ -218,7 +218,7 @@ private function shouldSkipForeachExpr(Expr $foreachExpr, Scope $scope): bool
}

$ifType = $scope->getNativeType($foreachExpr);
if (!$ifType->isArray()->yes()) {
if (! $ifType->isArray()->yes()) {
return true;
}
}
Expand Down
Expand Up @@ -194,7 +194,7 @@ private function shouldSkip(StmtsAwareInterface $stmtsAware, int $key, Stmt $stm
}
}

return isset($stmtsAware->stmts[$key+1]) && $stmtsAware->stmts[$key+1] instanceof InlineHTML;
return isset($stmtsAware->stmts[$key + 1]) && $stmtsAware->stmts[$key + 1] instanceof InlineHTML;
}

private function hasVariableName(Stmt $stmt, string $variableName): bool
Expand Down
Expand Up @@ -39,8 +39,9 @@
*/
final class NumericReturnTypeFromStrictScalarReturnsRector extends AbstractScopeAwareRector implements MinPhpVersionInterface
{
public function __construct(private readonly ClassMethodReturnTypeOverrideGuard $classMethodReturnTypeOverrideGuard)
{
public function __construct(
private readonly ClassMethodReturnTypeOverrideGuard $classMethodReturnTypeOverrideGuard
) {
}

public function getRuleDefinition(): RuleDefinition
Expand Down Expand Up @@ -92,7 +93,10 @@ public function refactorWithScope(Node $node, Scope $scope): ?Node
return null;
}

if ($node instanceof ClassMethod && $this->classMethodReturnTypeOverrideGuard->shouldSkipClassMethod($node, $scope)) {
if ($node instanceof ClassMethod && $this->classMethodReturnTypeOverrideGuard->shouldSkipClassMethod(
$node,
$scope
)) {
return null;
}

Expand Down

0 comments on commit 9cf016c

Please sign in to comment.