Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | trait INSLinker |
||
18 | { |
||
19 | /** |
||
20 | * @var Linker[] |
||
21 | */ |
||
22 | private $linked = []; |
||
23 | |||
24 | /** |
||
25 | * @param Endpoint $endpoint |
||
26 | * @param Consuming $consuming |
||
27 | * @return Linker |
||
28 | */ |
||
29 | protected function linking(Endpoint $endpoint, Consuming $consuming = null) : Linker |
||
30 | { |
||
31 | return |
||
32 | $this->linked[(string)$endpoint->address()] ?? |
||
33 | $this->linked[(string)$endpoint->address()] = new Linker($endpoint, $consuming); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param Endpoint $endpoint |
||
38 | * @return Linker |
||
39 | */ |
||
40 | protected function linker(Endpoint $endpoint) : Linker |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @param Closure $operator |
||
47 | */ |
||
48 | protected function linkers(Closure $operator) : void |
||
57 | ); |
||
58 | } |
||
62 |