Total Complexity | 5 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | trait EndpointsPersistent |
||
14 | { |
||
15 | /** |
||
16 | * @var Endpoint[] |
||
17 | */ |
||
18 | private $staticEndpoints = []; |
||
19 | |||
20 | /** |
||
21 | * @param Endpoint ...$endpoints |
||
22 | * @return static |
||
23 | */ |
||
24 | public function addEndpoint(Endpoint ...$endpoints) : self |
||
25 | { |
||
26 | foreach ($endpoints as $endpoint) { |
||
27 | isset($this->staticEndpoints[$i = $endpoint->id()]) || $this->staticEndpoints[$i] = $endpoint; |
||
28 | } |
||
29 | |||
30 | return $this; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @return Endpoint |
||
35 | */ |
||
36 | protected function staticEndpoint() : Endpoint |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return array |
||
43 | */ |
||
44 | protected function staticEndpoints() : array |
||
49 |