Skip to content

Commit

Permalink
Clean up via rector / linting (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfox authored Jun 22, 2024
1 parent ae7794f commit 9959aaf
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Rector/Class_/ReplaceExpectsMethodsInTestsRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getNodeTypes(): array
}

/**
* @param Node\Stmt\Class_ $node
* @param Class_ $node
*/
public function refactor(Node $node): ?Class_
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function refactor(Node $node): MethodCall|StaticCall|null
return null;
}

/** @var Node\Expr\MethodCall|Node\Expr\StaticCall|null $methodCall */
/** @var MethodCall|StaticCall|null $methodCall */
$methodCall = array_values(
array_filter(
[$node->left, $node->right],
Expand Down
2 changes: 1 addition & 1 deletion src/Rector/FuncCall/FactoryFuncCallToStaticCallRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getNodeTypes(): array
}

/**
* @param Node\Expr\FuncCall $node
* @param FuncCall $node
*/
public function refactor(Node $node): ?Node
{
Expand Down
2 changes: 1 addition & 1 deletion src/Rector/FuncCall/SleepFuncToSleepStaticCallRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getNodeTypes(): array
}

/**
* @param Node\Stmt\Expression $node
* @param Expression $node
*/
public function refactor(Node $node): ?Node
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private function changeClosureParamType(MethodCall|StaticCall $node): void
['whereHasMorph', 'orWhereHasMorph', 'whereDoesntHaveMorph', 'orWhereDoesntHaveMorph']
) ? 2 : 1;

/** @var Node\Expr\ArrowFunction|Node\Expr\Closure $closure */
/** @var ArrowFunction|Closure $closure */
$closure = $node->getArgs()[$position]
->value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function isWhereMethodWithClosureOrArrowFunction(MethodCall|StaticCall $

private function changeClosureParamType(MethodCall|StaticCall $node): void
{
/** @var Node\Expr\ArrowFunction|Node\Expr\Closure $closure */
/** @var ArrowFunction|Closure $closure */
$closure = $node->getArgs()[0]
->value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function getNodeTypes(): array
}

/**
* @param Node\Expr\MethodCall $node
* @param MethodCall $node
*/
public function refactor(Node $node): ?MethodCall
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getNodeTypes(): array
}

/**
* @param Node\Expr\MethodCall $node
* @param MethodCall $node
*/
public function refactor(Node $node): ?StaticCall
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ public function refactor(Node $node): ?Node
return null;
}

$queryMethodCall = $this->nodeFactory->createStaticCall($originalClassName, 'query');
$staticCall = $this->nodeFactory->createStaticCall($originalClassName, 'query');

$newNode = $this->nodeFactory->createMethodCall($queryMethodCall, $methodName);
$methodCall = $this->nodeFactory->createMethodCall($staticCall, $methodName);
foreach ($node->args as $arg) {
$newNode->args[] = $arg;
$methodCall->args[] = $arg;
}

return $newNode;
return $methodCall;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getNodeTypes(): array
}

/**
* @param Node\Expr\StaticCall $node
* @param StaticCall $node
*/
public function refactor(Node $node): ?StaticCall
{
Expand Down

0 comments on commit 9959aaf

Please sign in to comment.