Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Rector upgrades rules for Laravel Framework",
"require": {
"php": ">=8.3",
"rector/rector": "^2.3.0",
"rector/rector": "^2.4.1",
"webmozart/assert": "^1.11 || ^2.0",
"symplify/rule-doc-generator-contracts": "^11.2"
},
Expand Down
1 change: 1 addition & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// for tests
'*/Source/*',
'*/Fixture/*',
'*/tests/NodeAnalyzer/fixtures/*',

// skip for handle scoped, like in the rector-src as well
// @see https://github.com/rectorphp/rector-src/blob/7f73cf017214257c170d34db3af7283eaeeab657/rector.php#L71
Expand Down
2 changes: 2 additions & 0 deletions src/AbstractRector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel;

use Rector\Rector\AbstractRector as BaseAbstractRector;
Expand Down
2 changes: 2 additions & 0 deletions src/NodeAnalyzer/FacadeAssertionAnalyzer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\NodeAnalyzer;

use PhpParser\Node\Expr\StaticCall;
Expand Down
2 changes: 2 additions & 0 deletions src/NodeAnalyzer/RelationshipAnalyzer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\NodeAnalyzer;

use Illuminate\Database\Eloquent\Relations\Relation;
Expand Down
2 changes: 2 additions & 0 deletions src/NodeFactory/DispatchableTestsMethodsFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\NodeFactory;

use PhpParser\Node\Arg;
Expand Down
2 changes: 0 additions & 2 deletions src/Rector/FuncCall/TypeHintTappableCallRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public function refactor(Node $node): ?Node
return null;
}

/** @var Closure $closure */
$closure = $node->getArgs()[1]->value;

if ($closure->getParams() === []) {
Expand Down Expand Up @@ -114,7 +113,6 @@ private function refactorMethodCall(MethodCall $methodCall): ?MethodCall
return null;
}

/** @var Closure $closure */
$closure = $methodCall->getArgs()[0]->value;

if ($closure->getParams() === []) {
Expand Down
3 changes: 2 additions & 1 deletion src/Rector/If_/AbortIfRector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\Rector\If_;

use PhpParser\Node;
Expand Down Expand Up @@ -71,7 +73,6 @@ public function refactor(Node $node): ?Node
$this->isName($ifStmts[0]->expr, 'abort')
) {
$condition = $node->cond;
/** @var FuncCall $abortCall */
$abortCall = $ifStmts[0]->expr;

if ($this->exceptionUsesVariablesAssignedByCondition($abortCall, $condition)) {
Expand Down
3 changes: 2 additions & 1 deletion src/Rector/If_/ReportIfRector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\Rector\If_;

use PhpParser\Node;
Expand Down Expand Up @@ -71,7 +73,6 @@ public function refactor(Node $node): ?Node
$this->isName($ifStmts[0]->expr, 'report')
) {
$condition = $node->cond;
/** @var FuncCall $abortCall */
$abortCall = $ifStmts[0]->expr;

if ($this->exceptionUsesVariablesAssignedByCondition($abortCall, $condition)) {
Expand Down
2 changes: 2 additions & 0 deletions src/Rector/StaticCall/CarbonSetTestNowToTravelToRector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\Rector\StaticCall;

use PhpParser\Node;
Expand Down
2 changes: 1 addition & 1 deletion src/Rector/StaticCall/RouteActionCallableRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private function resolveControllerFromAction(mixed $action, ?string $groupNamesp
}

[$controller, $method] = $segments;
$namespace = $this->getNamespace($this->file->getFilePath());
$namespace = $this->getNamespace($this->getFile()->getFilePath());
if ($groupNamespace !== null) {
$namespace .= '\\' . $groupNamespace;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Set/LaravelSetProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\Set;

use Rector\Set\Contract\SetInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Set/Packages/Faker/FakerSetList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\Set\Packages\Faker;

final class FakerSetList
Expand Down
2 changes: 2 additions & 0 deletions src/Set/Packages/Livewire/LivewireSetList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\Set\Packages\Livewire;

final class LivewireSetList
Expand Down
2 changes: 2 additions & 0 deletions src/ValueObject/ApplyDefaultInsteadOfNullCoalesce.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\ValueObject;

use PHPStan\Type\ObjectType;
Expand Down
2 changes: 2 additions & 0 deletions src/ValueObject/ExpectedClassMethodMethodCalls.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\ValueObject;

use PhpParser\Node\Expr\ClassConstFetch;
Expand Down
2 changes: 2 additions & 0 deletions src/ValueObject/ForwardingCall.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\ValueObject;

use PhpParser\Node\Expr;
Expand Down
2 changes: 2 additions & 0 deletions src/ValueObject/ReplaceRequestKeyAndMethodValue.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\ValueObject;

use Webmozart\Assert\Assert;
Expand Down
2 changes: 2 additions & 0 deletions src/ValueObject/ReplaceServiceContainerCallArg.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\ValueObject;

use PhpParser\Node\Expr\ClassConstFetch;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace RectorLaravel\Tests\Rector\StaticCall\DispatchToHelperFunctionsRector;

use Iterator;
Expand Down