-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor use import resolving (#4998)
- Loading branch information
Showing
6 changed files
with
91 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
rules/CodingStyle/ClassNameImport/ValueObject/UsedImports.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\CodingStyle\ClassNameImport\ValueObject; | ||
|
||
use Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType; | ||
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType; | ||
|
||
final class UsedImports { | ||
/** | ||
* @param array<FullyQualifiedObjectType|AliasedObjectType> $useImports | ||
* @param FullyQualifiedObjectType[] $functionImports | ||
* @param FullyQualifiedObjectType[] $constantImports | ||
*/ | ||
public function __construct(private readonly array $useImports, private readonly array $functionImports, private readonly array $constantImports) | ||
{ | ||
} | ||
|
||
/** | ||
* @return array<FullyQualifiedObjectType|AliasedObjectType> | ||
*/ | ||
public function getUseImports() : array | ||
{ | ||
return $this->useImports; | ||
} | ||
|
||
/** | ||
* @return FullyQualifiedObjectType[] | ||
*/ | ||
public function getFunctionImports() : array | ||
{ | ||
return $this->functionImports; | ||
} | ||
|
||
/** | ||
* @return FullyQualifiedObjectType[] | ||
*/ | ||
public function getConstantImports() : array | ||
{ | ||
return $this->constantImports; | ||
} | ||
} |