Skip to content

Commit

Permalink
Updated Rector to commit aa52c4ecedb83773b12c4d3b2906ba36601057ba
Browse files Browse the repository at this point in the history
rectorphp/rector-src@aa52c4e [Reflection] Remove usage on PrivatesAccessor on ClassReflectionAnalyzer (#5366)
  • Loading branch information
TomasVotruba committed Dec 17, 2023
1 parent d525e92 commit aba5aec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '1dcebfe29713124a43504c9a4bac322fa2f41f59';
public const PACKAGE_VERSION = 'aa52c4ecedb83773b12c4d3b2906ba36601057ba';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-12-17 00:28:05';
public const RELEASE_DATE = '2023-12-17 13:05:17';
/**
* @var int
*/
Expand Down
15 changes: 1 addition & 14 deletions src/Reflection/ClassReflectionAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,16 @@
declare (strict_types=1);
namespace Rector\Core\Reflection;

use PHPStan\BetterReflection\Reflection\ReflectionClass;
use PHPStan\Reflection\ClassReflection;
use Rector\Core\Util\Reflection\PrivatesAccessor;
use ReflectionEnum;
final class ClassReflectionAnalyzer
{
/**
* @readonly
* @var \Rector\Core\Util\Reflection\PrivatesAccessor
*/
private $privatesAccessor;
public function __construct(PrivatesAccessor $privatesAccessor)
{
$this->privatesAccessor = $privatesAccessor;
}
public function resolveParentClassName(ClassReflection $classReflection) : ?string
{
$nativeReflection = $classReflection->getNativeReflection();
if ($nativeReflection instanceof ReflectionEnum) {
return null;
}
$betterReflectionClass = $this->privatesAccessor->getPrivateProperty($nativeReflection, 'betterReflectionClass');
/** @var ReflectionClass $betterReflectionClass */
return $betterReflectionClass->getParentClassName();
return $nativeReflection->getParentClassName();
}
}

0 comments on commit aba5aec

Please sign in to comment.