1 | <?php |
||
21 | class FlowCollection implements IteratorAggregate, Serializable |
||
22 | { |
||
23 | /** |
||
24 | * @var FlowInterface[] |
||
25 | */ |
||
26 | protected $items = []; |
||
27 | |||
28 | /** |
||
29 | * FlowCollection constructor. |
||
30 | * |
||
31 | * @param FlowInterface ...$flows |
||
32 | */ |
||
|
|||
33 | 59 | public function __construct(...$flows) |
|
37 | |||
38 | /** |
||
39 | * @param FlowInterface[] $items |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | 59 | public function addFlows(array $items) |
|
44 | { |
||
45 | 59 | foreach ($items as $item) { |
|
46 | 14 | $this->add($item); |
|
47 | 59 | } |
|
48 | |||
49 | 59 | return $this; |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return FlowInterface[] |
||
54 | */ |
||
55 | 3 | public function getAll() |
|
59 | |||
60 | /** |
||
61 | * @param FlowInterface $flow |
||
62 | * |
||
63 | * @return static |
||
64 | */ |
||
65 | 55 | public function add(FlowInterface $flow) |
|
71 | |||
72 | /** |
||
73 | * @param FlowInterface $flow |
||
74 | * |
||
75 | * @return static |
||
76 | */ |
||
77 | 1 | public function remove(FlowInterface $flow) |
|
78 | { |
||
79 | 1 | $index = array_search($flow, $this->items, true); |
|
80 | 1 | if ($index !== false) { |
|
81 | 1 | unset($this->items[$index]); |
|
82 | 1 | $this->items = array_values($this->items); |
|
83 | 1 | } |
|
84 | |||
85 | 1 | return $this; |
|
86 | } |
||
87 | |||
88 | /** |
||
89 | * @param FlowInterface $flow |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | 1 | public function contains(FlowInterface $flow) |
|
97 | |||
98 | /** |
||
99 | * @return int |
||
100 | */ |
||
101 | 3 | public function count() |
|
105 | |||
106 | /** |
||
107 | * @return ArrayIterator |
||
108 | */ |
||
109 | 1 | public function getIterator() |
|
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | 1 | public function serialize() |
|
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | 1 | public function unserialize($data) |
|
129 | } |
||
130 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.