Total Complexity | 10 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
7 | class ClassName |
||
8 | { |
||
9 | /** @var ReflectionClass e*/ |
||
10 | private $classReflection; |
||
11 | |||
12 | public function __construct(string $className) |
||
18 | } |
||
19 | } |
||
20 | |||
21 | public function getParents() : ClassNameCollection |
||
22 | { |
||
23 | $parents = new ClassNameCollection(); |
||
24 | |||
25 | foreach (class_parents((string) $this) as $parent) { |
||
26 | $parents->add(new self($parent)); |
||
27 | } |
||
28 | |||
29 | return $parents; |
||
30 | } |
||
31 | |||
32 | public function mustHaveMethod(string $methodName) : void |
||
33 | { |
||
34 | if ($this->classReflection->hasMethod($methodName) === false) { |
||
35 | throw ClassNameException::missingMethod((string) $this, $methodName); |
||
36 | } |
||
37 | } |
||
38 | |||
39 | public function mustImplement(string $interfaceName) : void |
||
43 | } |
||
44 | } |
||
45 | |||
46 | public function equals(self $namespace) : bool |
||
49 | } |
||
50 | |||
51 | public function __toString() : string |
||
54 | } |
||
55 | } |
||
56 |