| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class plPhpTypeDeclaration |
||
| 9 | { |
||
| 10 | /** @var string[] All valid types for PHP 7.1 */ |
||
| 11 | private static $builtInTypes = [ |
||
| 12 | 'int', 'bool', 'string', 'array', 'float', 'callable', 'iterable' |
||
| 13 | ]; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | private $name; |
||
| 17 | |||
| 18 | public function __construct(?string $name) |
||
| 19 | { |
||
| 20 | $this->name = $name; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function isPresent(): bool |
||
| 24 | { |
||
| 25 | return $this->name !== null; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * This will help when building the relationships between classes/interfaces since built-in |
||
| 30 | * types are not part of a UML class diagram |
||
| 31 | */ |
||
| 32 | public function isBuiltIn(): bool |
||
| 35 | } |
||
| 36 | |||
| 37 | public function __toString() |
||
| 42 |