mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-12 06:02:23 +00:00
7e7a2f067a
476cfb00cb
disable fallback for now
44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\StaticTypeMapper\ValueObject\Type;
|
|
|
|
use PHPStan\TrinaryLogic;
|
|
use PHPStan\Type\ObjectType;
|
|
use PHPStan\Type\Type;
|
|
/**
|
|
* @api
|
|
*/
|
|
final class ShortenedObjectType extends ObjectType
|
|
{
|
|
/**
|
|
* @var class-string
|
|
* @readonly
|
|
*/
|
|
private $fullyQualifiedName;
|
|
/**
|
|
* @param class-string $fullyQualifiedName
|
|
*/
|
|
public function __construct(string $shortName, string $fullyQualifiedName)
|
|
{
|
|
$this->fullyQualifiedName = $fullyQualifiedName;
|
|
parent::__construct($shortName);
|
|
}
|
|
public function isSuperTypeOf(Type $type) : TrinaryLogic
|
|
{
|
|
$fullyQualifiedObjectType = new ObjectType($this->fullyQualifiedName);
|
|
return $fullyQualifiedObjectType->isSuperTypeOf($type);
|
|
}
|
|
public function getShortName() : string
|
|
{
|
|
return $this->getClassName();
|
|
}
|
|
/**
|
|
* @return class-string
|
|
*/
|
|
public function getFullyQualifiedName() : string
|
|
{
|
|
return $this->fullyQualifiedName;
|
|
}
|
|
}
|