Total Complexity | 6 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class Attribute extends Variable |
||
16 | { |
||
17 | /** @var Visibility */ |
||
18 | public $modifier; |
||
19 | |||
20 | protected function __construct(string $name, Visibility $modifier, TypeDeclaration $type) |
||
21 | { |
||
22 | parent::__construct($name, $type); |
||
23 | $this->modifier = $modifier; |
||
24 | } |
||
25 | |||
26 | public static function public(string $name, TypeDeclaration $type = null): Attribute |
||
27 | { |
||
28 | return new Attribute($name, Visibility::public(), $type ?? TypeDeclaration::absent()); |
||
29 | } |
||
30 | |||
31 | public static function protected(string $name, TypeDeclaration $type = null): Attribute |
||
34 | } |
||
35 | |||
36 | public static function private(string $name, TypeDeclaration $type = null): Attribute |
||
37 | { |
||
38 | return new Attribute($name, Visibility::private(), $type ?? TypeDeclaration::absent()); |
||
39 | } |
||
40 | |||
41 | public function isTyped(): bool |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * It doesn't currently support information type |
||
48 | * |
||
49 | * @see GraphvizProcessor#getClassDefinition In its original version |
||
50 | */ |
||
51 | public function __toString() |
||
54 | } |
||
55 | } |
||
56 |