Skip to content

Commit

Permalink
[automated] Apply Coding Standard (#5600)
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 Feb 11, 2024
1 parent f4c674c commit 333f38b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
29 changes: 16 additions & 13 deletions src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\NodeTypeResolver\PHPStan\Scope;

use Throwable;
use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr;
Expand Down Expand Up @@ -62,6 +61,7 @@
use Rector\PHPStan\NodeVisitor\ExprScopeFromStmtNodeVisitor;
use Rector\PHPStan\NodeVisitor\WrappedNodeRestoringNodeVisitor;
use Rector\Util\Reflection\PrivatesAccessor;
use Throwable;
use Webmozart\Assert\Assert;

/**
Expand Down Expand Up @@ -208,12 +208,25 @@ public function processNodes(
return $stmts;
}

public function hasUnreachableStatementNode(): bool
{
return $this->hasUnreachableStatementNode;
}

public function resetHasUnreachableStatementNode(): void
{
$this->hasUnreachableStatementNode = false;
}

/**
* @param Stmt[] $stmts
* @param callable(Node $node, MutatingScope $scope): void $nodeCallback
*/
private function nodeScopeResolverProcessNodes(array $stmts, MutatingScope $mutatingScope, callable $nodeCallback): void
{
private function nodeScopeResolverProcessNodes(
array $stmts,
MutatingScope $mutatingScope,
callable $nodeCallback
): void {
try {
$this->nodeScopeResolver->processNodes($stmts, $mutatingScope, $nodeCallback);
} catch (Throwable $throwable) {
Expand All @@ -223,16 +236,6 @@ private function nodeScopeResolverProcessNodes(array $stmts, MutatingScope $muta
}
}

public function hasUnreachableStatementNode(): bool
{
return $this->hasUnreachableStatementNode;
}

public function resetHasUnreachableStatementNode(): void
{
$this->hasUnreachableStatementNode = false;
}

private function processCallike(CallLike $callLike, MutatingScope $mutatingScope): void
{
if ($callLike instanceof StaticCall) {
Expand Down
5 changes: 4 additions & 1 deletion src/NodeTypeResolver/TypeComparator/TypeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public function arePhpParserAndPhpStanPhpDocTypesEqual(
$node
);

if (! $this->areTypesEqual($phpParserNodeType, $phpStanDocType) && $this->isSubtype($phpStanDocType, $phpParserNodeType)) {
if (! $this->areTypesEqual($phpParserNodeType, $phpStanDocType) && $this->isSubtype(
$phpStanDocType,
$phpParserNodeType
)) {
return false;
}

Expand Down

0 comments on commit 333f38b

Please sign in to comment.