mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit c5d3a0e1913fb0057513dd70122d8eef4d226e1c
c5d3a0e191
[CodingStyle] Clean up check last name on UseImportsRemover (#5173)
This commit is contained in:
parent
6fbeed5643
commit
3f64ea0f3f
|
@ -3,6 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\Application;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\Use_;
|
||||
use Rector\PostRector\Collector\UseNodesToAddCollector;
|
||||
|
@ -54,14 +55,14 @@ final class UseImportsRemover
|
|||
if (!\in_array($useName, $removedUses, \true)) {
|
||||
continue;
|
||||
}
|
||||
$lastUseName = Strings::after($useName, '\\', -1);
|
||||
foreach ($useImportTypes as $useImportType) {
|
||||
$className = $useImportType instanceof AliasedObjectType ? $useImportType->getFullyQualifiedName() : $useImportType->getClassName();
|
||||
if ($className === $useName) {
|
||||
if ($className === $useName || Strings::after($className, '\\', -1) === $lastUseName) {
|
||||
unset($use->uses[$usesKey]);
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
unset($use->uses[$usesKey]);
|
||||
}
|
||||
return $use;
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\DeadCode\Rector\If_;
|
||||
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Stmt;
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '29370c7ddfc45c6fe29d88cfca6aa56234a76874';
|
||||
public const PACKAGE_VERSION = 'c5d3a0e1913fb0057513dd70122d8eef4d226e1c';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-10-15 10:36:28';
|
||||
public const RELEASE_DATE = '2023-10-15 11:03:12';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue