Total Complexity | 5 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | class AnnotationCollection |
||
6 | { |
||
7 | /** |
||
8 | * @var array |
||
9 | */ |
||
10 | private $annotations; |
||
11 | |||
12 | 159 | public function __construct($annotations = []) |
|
13 | { |
||
14 | 159 | $this->annotations = $annotations; |
|
15 | 159 | } |
|
16 | |||
17 | 4 | public function getOneBy($class) |
|
18 | { |
||
19 | 4 | if ($result = $this->findOneBy($class)) { |
|
20 | 4 | return $result; |
|
21 | } |
||
22 | |||
23 | 4 | throw new \InvalidArgumentException(sprintf('Annotation %s not found in collection', $class)); |
|
24 | } |
||
25 | |||
26 | 14 | public function findOneBy($class) |
|
31 | } |
||
32 | |||
33 | 77 | public function findAllBy($class) |
|
40 | } |
||
41 | } |
||
42 |