1 | <?php |
||
11 | class AggregatorRelay |
||
12 | { |
||
13 | /** |
||
14 | * @var KeyGenerator |
||
15 | */ |
||
16 | private $keyGenerator; |
||
17 | |||
18 | /** |
||
19 | * @var Aggregator[] |
||
20 | */ |
||
21 | private $aggregators = []; |
||
22 | |||
23 | /** |
||
24 | * @param KeyGenerator $keyGenerator |
||
25 | * @param Factory $aggregatorFactory |
||
26 | */ |
||
27 | public function __construct(KeyGenerator $keyGenerator, Factory $aggregatorFactory) |
||
32 | |||
33 | /** |
||
34 | * @param CodepointAssigned $entity |
||
35 | * @throws InvalidArgumentException |
||
36 | */ |
||
37 | public function add(CodepointAssigned $entity) |
||
42 | |||
43 | /** |
||
44 | * @param CodepointAssigned[] $entities |
||
45 | */ |
||
46 | public function addMany(array $entities) |
||
52 | |||
53 | /** |
||
54 | * @param CodepointAssigned $entity |
||
55 | * @return Aggregator |
||
56 | */ |
||
57 | protected function getAggregatorFor(CodepointAssigned $entity) |
||
67 | |||
68 | /** |
||
69 | * @return Aggregator[] |
||
70 | */ |
||
71 | public function getAll() |
||
75 | |||
76 | /** |
||
77 | * @return Range\Collection[] |
||
78 | */ |
||
79 | public function getAllRanges() |
||
89 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: