| Total Complexity | 6 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | abstract class Definition implements HasNodeIdentifier |
||
| 19 | { |
||
| 20 | use ObjectHashIdentifier; |
||
| 21 | |||
| 22 | /** @var string */ |
||
| 23 | protected $name; |
||
| 24 | |||
| 25 | /** @var Constant[] */ |
||
| 26 | protected $constants; |
||
| 27 | |||
| 28 | /** @var Method[] */ |
||
| 29 | protected $methods; |
||
| 30 | |||
| 31 | /** @var Definition */ |
||
| 32 | protected $extends; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param Constant[] $constants |
||
| 36 | * @param Method[] $methods |
||
| 37 | */ |
||
| 38 | public function __construct( |
||
| 48 | } |
||
| 49 | |||
| 50 | public function countMethodsByVisibility(Visibility $modifier): int |
||
| 51 | { |
||
| 52 | return \count(array_filter($this->methods, function (Method $method) use ($modifier) { |
||
| 53 | return $method->hasVisibility($modifier); |
||
| 54 | })); |
||
| 55 | } |
||
| 56 | |||
| 57 | public function name(): string |
||
| 58 | { |
||
| 59 | return $this->name; |
||
| 60 | } |
||
| 61 | |||
| 62 | abstract public function hasAttributes(): bool; |
||
| 63 | |||
| 64 | /** @return Constant[] */ |
||
| 65 | public function constants(): array |
||
| 66 | { |
||
| 67 | return $this->constants; |
||
| 68 | } |
||
| 69 | |||
| 70 | /** @return Method[] */ |
||
| 71 | public function methods(): array |
||
| 72 | { |
||
| 73 | return $this->methods; |
||
| 74 | } |
||
| 75 | |||
| 76 | public function extends(): Definition |
||
| 79 | } |
||
| 80 | } |
||
| 81 |