Total Complexity | 12 |
Total Lines | 86 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class Headers |
||
6 | { |
||
7 | /** @var Header[] */ |
||
8 | protected $headers; |
||
9 | |||
10 | /** @var int|null */ |
||
11 | protected $nPlurals; |
||
12 | |||
13 | /** |
||
14 | * Headers constructor. |
||
15 | * |
||
16 | * @param Header[] $headers |
||
17 | */ |
||
18 | public function __construct(array $headers = array()) |
||
22 | } |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @param string $headerKey |
||
27 | * |
||
28 | * @return bool |
||
29 | */ |
||
30 | public function has($headerKey) |
||
31 | { |
||
32 | return isset($this->headers[$headerKey]); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param string $headerKey |
||
37 | * |
||
38 | * @return Header|null |
||
39 | */ |
||
40 | public function get($headerKey) |
||
41 | { |
||
42 | if (!$this->has($headerKey)) { |
||
43 | return null; |
||
44 | } |
||
45 | |||
46 | return $this->headers[$headerKey]; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return Header[] |
||
51 | */ |
||
52 | public function all() |
||
53 | { |
||
54 | return $this->headers; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @param Header $header |
||
59 | */ |
||
60 | public function set(Header $header) |
||
61 | { |
||
62 | $this->headers[$header->getId()] = $header; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return int |
||
67 | */ |
||
68 | public function getPluralFormsCount() |
||
91 | } |
||
92 | |||
93 | /** |
||
94 | * @param string $headerName |
||
95 | * |
||
111 |