Skip to content

Commit 19c5340

Browse files
committed
Updated Rector to commit 6efa09477442d9bfed0989fdd1d773bb0d3fa5a2
rectorphp/rector-src@6efa094 [cleanup] Add unused public, remove unused methods and ignore rest (#7733)
1 parent bb2d472 commit 19c5340

File tree

12 files changed

+17
-83
lines changed

12 files changed

+17
-83
lines changed

rules/Php80/NodeAnalyzer/PhpAttributeAnalyzer.php

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,20 @@
99
use PhpParser\Node\Expr\Array_;
1010
use PhpParser\Node\Param;
1111
use PhpParser\Node\Scalar\String_;
12-
use PhpParser\Node\Stmt\Class_;
1312
use PhpParser\Node\Stmt\ClassLike;
1413
use PhpParser\Node\Stmt\ClassMethod;
1514
use PhpParser\Node\Stmt\Property;
16-
use PHPStan\Reflection\ReflectionProvider;
1715
use Rector\NodeNameResolver\NodeNameResolver;
18-
use Rector\Php81\Enum\AttributeName;
1916
use Rector\PhpAttribute\Enum\DocTagNodeState;
2017
final class PhpAttributeAnalyzer
2118
{
2219
/**
2320
* @readonly
2421
*/
2522
private NodeNameResolver $nodeNameResolver;
26-
/**
27-
* @readonly
28-
*/
29-
private ReflectionProvider $reflectionProvider;
30-
public function __construct(NodeNameResolver $nodeNameResolver, ReflectionProvider $reflectionProvider)
23+
public function __construct(NodeNameResolver $nodeNameResolver)
3124
{
3225
$this->nodeNameResolver = $nodeNameResolver;
33-
$this->reflectionProvider = $reflectionProvider;
3426
}
3527
/**
3628
* @param \PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\ClassLike|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Param $node
@@ -47,25 +39,6 @@ public function hasPhpAttribute($node, string $attributeClass): bool
4739
}
4840
return \false;
4941
}
50-
/**
51-
* @param AttributeName::* $attributeClass
52-
*/
53-
public function hasInheritedPhpAttribute(Class_ $class, string $attributeClass): bool
54-
{
55-
$className = (string) $this->nodeNameResolver->getName($class);
56-
if (!$this->reflectionProvider->hasClass($className)) {
57-
return \false;
58-
}
59-
$classReflection = $this->reflectionProvider->getClass($className);
60-
$ancestorClassReflections = array_merge($classReflection->getParents(), $classReflection->getInterfaces());
61-
foreach ($ancestorClassReflections as $ancestorClassReflection) {
62-
$nativeReflection = $ancestorClassReflection->getNativeReflection();
63-
if ((method_exists($nativeReflection, 'getAttributes') ? $nativeReflection->getAttributes($attributeClass) : []) !== []) {
64-
return \true;
65-
}
66-
}
67-
return \false;
68-
}
6942
/**
7043
* @param string[] $attributeClasses
7144
* @param \PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\ClassLike|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Param $node

rules/TypeDeclaration/ValueObject/DataProviderNodes.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ public function __construct(Class_ $class, array $attributes, array $phpDocTagNo
4444
Assert::allIsInstanceOf($attributes, Attribute::class);
4545
Assert::allIsInstanceOf($phpDocTagNodes, PhpDocTagNode::class);
4646
}
47-
public function isEmpty(): bool
48-
{
49-
return $this->getClassMethods() === [];
50-
}
5147
/**
5248
* @return ClassMethod[]
5349
*/

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'f5c7bbd7ce702f280c8a77df25d8b1274207464f';
22+
public const PACKAGE_VERSION = '6efa09477442d9bfed0989fdd1d773bb0d3fa5a2';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-12-07 22:45:12';
27+
public const RELEASE_DATE = '2025-12-08 00:49:28';
2828
/**
2929
* @var int
3030
*/

src/ChangesReporting/Output/GitHubOutputFormatter.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
*/
2121
final class GitHubOutputFormatter implements OutputFormatterInterface
2222
{
23-
/**
24-
* @var string
25-
*/
26-
public const NAME = 'github';
23+
private const NAME = 'github';
2724
private const GROUP_NAME = 'Rector report';
2825
public function getName(): string
2926
{

src/ChangesReporting/Output/GitlabOutputFormatter.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ final class GitlabOutputFormatter implements OutputFormatterInterface
1818
* @readonly
1919
*/
2020
private Filehasher $filehasher;
21-
/**
22-
* @var string
23-
*/
24-
public const NAME = 'gitlab';
21+
private const NAME = 'gitlab';
2522
private const ERROR_TYPE_ISSUE = 'issue';
2623
private const ERROR_CATEGORY_BUG_RISK = 'Bug Risk';
2724
private const ERROR_CATEGORY_STYLE = 'Style';

src/ChangesReporting/Output/JUnitOutputFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class JUnitOutputFormatter implements OutputFormatterInterface
1919
* @readonly
2020
*/
2121
private SymfonyStyle $symfonyStyle;
22-
public const NAME = 'junit';
22+
private const NAME = 'junit';
2323
private const XML_ATTRIBUTE_FILE = 'file';
2424
private const XML_ATTRIBUTE_NAME = 'name';
2525
private const XML_ATTRIBUTE_TYPE = 'type';

src/NodeTypeResolver/Node/AttributeKey.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,6 @@ final class AttributeKey
213213
* @var string
214214
*/
215215
public const IS_USED_AS_ARG_BY_REF_VALUE = 'is_used_as_arg_by_ref_value';
216-
/**
217-
* @deprecated as never used
218-
* @var string
219-
*/
220-
public const ATTRIBUTE_COMMENT = 'attribute_comment';
221216
/**
222217
* @var string
223218
*/

src/Reflection/ReflectionResolver.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
use PhpParser\Node\Name;
1717
use PhpParser\Node\Stmt\Class_;
1818
use PhpParser\Node\Stmt\ClassLike;
19-
use PhpParser\Node\Stmt\ClassMethod;
20-
use PhpParser\Node\Stmt\Function_;
2119
use PHPStan\Analyser\Scope;
2220
use PHPStan\Reflection\ClassReflection;
2321
use PHPStan\Reflection\FunctionReflection;
@@ -199,28 +197,6 @@ public function resolveFunctionLikeReflectionFromCall(CallLike $callLike)
199197
// todo: support NullsafeMethodCall
200198
return null;
201199
}
202-
public function resolveMethodReflectionFromClassMethod(ClassMethod $classMethod, Scope $scope): ?MethodReflection
203-
{
204-
$classReflection = $scope->getClassReflection();
205-
if (!$classReflection instanceof ClassReflection) {
206-
return null;
207-
}
208-
$className = $classReflection->getName();
209-
$methodName = $this->nodeNameResolver->getName($classMethod);
210-
return $this->resolveMethodReflection($className, $methodName, $scope);
211-
}
212-
public function resolveFunctionReflectionFromFunction(Function_ $function): ?FunctionReflection
213-
{
214-
$name = $this->nodeNameResolver->getName($function);
215-
if ($name === null) {
216-
return null;
217-
}
218-
$functionName = new Name($name);
219-
if ($this->reflectionProvider->hasFunction($functionName, null)) {
220-
return $this->reflectionProvider->getFunction($functionName, null);
221-
}
222-
return null;
223-
}
224200
public function resolveMethodReflectionFromNew(New_ $new): ?MethodReflection
225201
{
226202
$newClassType = $this->nodeTypeResolver->getType($new->class);

vendor/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
require_once __DIR__ . '/composer/autoload_real.php';
2121

22-
return ComposerAutoloaderInit9382e835eeb0e1e0bafb04fcb204a42a::getLoader();
22+
return ComposerAutoloaderInit12735a61b7a06210a61ac1597c9ec8fa::getLoader();

vendor/composer/autoload_real.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInit9382e835eeb0e1e0bafb04fcb204a42a
5+
class ComposerAutoloaderInit12735a61b7a06210a61ac1597c9ec8fa
66
{
77
private static $loader;
88

@@ -22,17 +22,17 @@ public static function getLoader()
2222
return self::$loader;
2323
}
2424

25-
spl_autoload_register(array('ComposerAutoloaderInit9382e835eeb0e1e0bafb04fcb204a42a', 'loadClassLoader'), true, true);
25+
spl_autoload_register(array('ComposerAutoloaderInit12735a61b7a06210a61ac1597c9ec8fa', 'loadClassLoader'), true, true);
2626
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27-
spl_autoload_unregister(array('ComposerAutoloaderInit9382e835eeb0e1e0bafb04fcb204a42a', 'loadClassLoader'));
27+
spl_autoload_unregister(array('ComposerAutoloaderInit12735a61b7a06210a61ac1597c9ec8fa', 'loadClassLoader'));
2828

2929
require __DIR__ . '/autoload_static.php';
30-
call_user_func(\Composer\Autoload\ComposerStaticInit9382e835eeb0e1e0bafb04fcb204a42a::getInitializer($loader));
30+
call_user_func(\Composer\Autoload\ComposerStaticInit12735a61b7a06210a61ac1597c9ec8fa::getInitializer($loader));
3131

3232
$loader->setClassMapAuthoritative(true);
3333
$loader->register(true);
3434

35-
$filesToLoad = \Composer\Autoload\ComposerStaticInit9382e835eeb0e1e0bafb04fcb204a42a::$files;
35+
$filesToLoad = \Composer\Autoload\ComposerStaticInit12735a61b7a06210a61ac1597c9ec8fa::$files;
3636
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
3737
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
3838
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

0 commit comments

Comments
 (0)