| 1 | <?php declare(strict_types=1); |
||
| 7 | final class PhpClass |
||
| 8 | { |
||
| 9 | use FullyQualifiedNameTrait; |
||
| 10 | use SourceTrait; |
||
| 11 | |||
| 12 | /** @var PhpMethod[] */ |
||
| 13 | private $methods = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param string $name |
||
| 17 | * @param PhpMethod[] $methods |
||
| 18 | * @param string $source |
||
| 19 | */ |
||
| 20 | 10 | public function __construct(string $name, array $methods = [], string $source = '') |
|
| 26 | |||
| 27 | 10 | public function addMethods(array $methods) |
|
| 33 | |||
| 34 | 8 | public function addMethod(PhpMethod $method) |
|
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $name |
||
| 41 | * |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | 4 | public function hasMethod($name) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @return PhpMethod[] |
||
| 51 | */ |
||
| 52 | 1 | public function getMethods() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * @param string $name |
||
| 59 | * |
||
| 60 | * @return PhpMethod |
||
| 61 | * |
||
| 62 | * @throws OutOfBoundsException |
||
| 63 | */ |
||
| 64 | 3 | public function getMethod($name) |
|
| 72 | } |
||
| 73 |