mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-20 23:41:57 +02:00
Updated Rector to commit 1eb04d6fae817aa0bd79d8606724d5eddd2f54df
1eb04d6fae
[automated] Apply Coding Standard (#6269)
This commit is contained in:
parent
71850def81
commit
17e003bf59
@ -46,28 +46,6 @@ final class ClassNameImportSkipper
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
private function shouldSkipShortName(FullyQualified $fullyQualified) : bool
|
||||
{
|
||||
// is scalar name?
|
||||
if (\in_array($fullyQualified->toLowerString(), ['true', 'false', 'bool'], \true)) {
|
||||
return \true;
|
||||
}
|
||||
if ($fullyQualified->isSpecialClassName()) {
|
||||
return \true;
|
||||
}
|
||||
if ($this->isFunctionOrConstantImport($fullyQualified)) {
|
||||
return \true;
|
||||
}
|
||||
// Importing root namespace classes (like \DateTime) is optional
|
||||
return !SimpleParameterProvider::provideBoolParameter(Option::IMPORT_SHORT_CLASSES);
|
||||
}
|
||||
private function isFunctionOrConstantImport(FullyQualified $fullyQualified) : bool
|
||||
{
|
||||
if ($fullyQualified->getAttribute(AttributeKey::IS_CONSTFETCH_NAME) === \true) {
|
||||
return \true;
|
||||
}
|
||||
return $fullyQualified->getAttribute(AttributeKey::IS_FUNCCALL_NAME) === \true;
|
||||
}
|
||||
/**
|
||||
* @param array<Use_|GroupUse> $uses
|
||||
*/
|
||||
@ -102,6 +80,28 @@ final class ClassNameImportSkipper
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
private function shouldSkipShortName(FullyQualified $fullyQualified) : bool
|
||||
{
|
||||
// is scalar name?
|
||||
if (\in_array($fullyQualified->toLowerString(), ['true', 'false', 'bool'], \true)) {
|
||||
return \true;
|
||||
}
|
||||
if ($fullyQualified->isSpecialClassName()) {
|
||||
return \true;
|
||||
}
|
||||
if ($this->isFunctionOrConstantImport($fullyQualified)) {
|
||||
return \true;
|
||||
}
|
||||
// Importing root namespace classes (like \DateTime) is optional
|
||||
return !SimpleParameterProvider::provideBoolParameter(Option::IMPORT_SHORT_CLASSES);
|
||||
}
|
||||
private function isFunctionOrConstantImport(FullyQualified $fullyQualified) : bool
|
||||
{
|
||||
if ($fullyQualified->getAttribute(AttributeKey::IS_CONSTFETCH_NAME) === \true) {
|
||||
return \true;
|
||||
}
|
||||
return $fullyQualified->getAttribute(AttributeKey::IS_FUNCCALL_NAME) === \true;
|
||||
}
|
||||
private function isConflictedShortNameInUse(UseUse $useUse, string $useName, string $lastUseName, string $stringName) : bool
|
||||
{
|
||||
if (!$useUse->alias instanceof Identifier && $useName !== $stringName && $lastUseName === $stringName) {
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '4eacb1ccc94f378eec0f3a08dbd8c90935d8d248';
|
||||
public const PACKAGE_VERSION = '1eb04d6fae817aa0bd79d8606724d5eddd2f54df';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-09-01 00:34:54';
|
||||
public const RELEASE_DATE = '2024-09-01 00:35:29';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user