Skip to content

Commit

Permalink
[ci-review] Rector Rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 3, 2024
1 parent 874fdbc commit df6c206
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Rector\TypeDeclaration\Rector\ClassMethod;

use PhpParser\Node\Expr\UnaryMinus;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
Expand Down Expand Up @@ -152,7 +153,7 @@ private function isAlwaysNumeric(array $returns): bool

foreach ($returns as $return) {
$epxr = $return->expr;
if ($epxr instanceof Expr\UnaryMinus) {
if ($epxr instanceof UnaryMinus) {
$epxr = $epxr->expr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Rector\TypeDeclaration\Rector\ClassMethod;

use PhpParser\Node\Expr\UnaryMinus;
use PhpParser\Node;
use PhpParser\Node\Identifier;
use PhpParser\Node\Scalar\DNumber;
Expand Down Expand Up @@ -85,7 +86,7 @@ public function refactorWithScope(Node $node, Scope $scope): ?Node

foreach ($returns as $return) {
$expr = $return->expr;
if ($expr instanceof Node\Expr\UnaryMinus) {
if ($expr instanceof UnaryMinus) {
$expr = $expr->expr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ final class ReturnTypeFromStrictScalarReturnExprRector extends AbstractScopeAwar
*/
public const HARD_CODED_ONLY = 'hard_coded_only';

/**
* @api
*/
private bool $hardCodedOnly = false;

public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition('Change return type based on strict scalar returns - string, int, float or bool', [
Expand Down Expand Up @@ -108,7 +103,5 @@ public function configure(array $configuration): void
{
$hardCodedOnly = $configuration[self::HARD_CODED_ONLY] ?? false;
Assert::boolean($hardCodedOnly);

$this->hardCodedOnly = $hardCodedOnly;
}
}

0 comments on commit df6c206

Please sign in to comment.