| Total Complexity | 8 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 15 | final class ClassType implements TypeArgument |
||
| 16 | { |
||
| 17 | /** @var ReflectionClass */ |
||
| 18 | private $reflection; |
||
| 19 | |||
| 20 | public function __construct(ReflectionClass $reflection) |
||
| 21 | { |
||
| 22 | $this->reflection = $reflection; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** @throws ReflectionException */ |
||
| 26 | public static function fromFullName(string $fqcn): self |
||
| 27 | { |
||
| 28 | return new self(new ReflectionClass($fqcn)); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function typeCheck(Expr $expr): Node |
||
| 34 | } |
||
| 35 | |||
| 36 | public function typeFetch(): Node |
||
| 37 | { |
||
| 38 | return new ClassConstFetch($this->nameNode(), new Identifier('class')); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function requiresImport(): bool |
||
| 42 | { |
||
| 43 | return true; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function fullName(): string |
||
| 47 | { |
||
| 48 | return $this->reflection->getName(); |
||
| 49 | } |
||
| 50 | |||
| 51 | public function __toString(): string |
||
| 54 | } |
||
| 55 | |||
| 56 | private function nameNode(): Name |
||
| 57 | { |
||
| 59 | } |
||
| 60 | } |
||
| 61 |