1 | <?php |
||
2 | declare(strict_types = 1); |
||
3 | |||
4 | namespace Innmind\Immutable\Sequence; |
||
5 | |||
6 | use Innmind\Immutable\{ |
||
7 | Map, |
||
8 | Sequence, |
||
9 | Str, |
||
10 | Exception\LogicException, |
||
11 | Exception\CannotGroupEmptyStructure, |
||
12 | Exception\ElementNotFound, |
||
13 | }; |
||
14 | |||
15 | /** |
||
16 | * @template T |
||
17 | */ |
||
18 | interface Implementation extends \Countable |
||
19 | { |
||
20 | /** |
||
21 | * Type of the elements |
||
22 | */ |
||
23 | public function type(): string; |
||
24 | |||
25 | public function size(): int; |
||
26 | public function toArray(): array; |
||
27 | |||
28 | /** |
||
29 | * Return the element at the given index |
||
30 | * |
||
31 | * @throws OutOfBoundException |
||
32 | * |
||
33 | * @return T |
||
0 ignored issues
–
show
|
|||
34 | */ |
||
35 | public function get(int $index); |
||
36 | |||
37 | /** |
||
38 | * Return the diff between this sequence and another |
||
39 | * |
||
40 | * @param self<T> $sequence |
||
41 | * |
||
42 | * @return self<T> |
||
43 | */ |
||
44 | public function diff(self $sequence): self; |
||
45 | |||
46 | /** |
||
47 | * Remove all duplicates from the sequence |
||
48 | * |
||
49 | * @return self<T> |
||
50 | */ |
||
51 | public function distinct(): self; |
||
52 | |||
53 | /** |
||
54 | * Remove the n first elements |
||
55 | * |
||
56 | * @return self<T> |
||
57 | */ |
||
58 | public function drop(int $size): self; |
||
59 | |||
60 | /** |
||
61 | * Remove the n last elements |
||
62 | * |
||
63 | * @return self<T> |
||
64 | */ |
||
65 | public function dropEnd(int $size): self; |
||
66 | |||
67 | /** |
||
68 | * Check if the two sequences are equal |
||
69 | * |
||
70 | * @param self<T> $sequence |
||
71 | */ |
||
72 | public function equals(self $sequence): bool; |
||
73 | |||
74 | /** |
||
75 | * Return all elements that satisfy the given predicate |
||
76 | * |
||
77 | * @param callable(T): bool $predicate |
||
78 | * |
||
79 | * @return self<T> |
||
80 | */ |
||
81 | public function filter(callable $predicate): self; |
||
82 | |||
83 | /** |
||
84 | * Apply the given function to all elements of the sequence |
||
85 | * |
||
86 | * @param callable(T): void $function |
||
87 | * |
||
88 | * @return self<T> |
||
89 | */ |
||
90 | public function foreach(callable $function): void; |
||
91 | |||
92 | /** |
||
93 | * Return a new map of pairs grouped by keys determined with the given |
||
94 | * discriminator function |
||
95 | * |
||
96 | * @param callable(T) $discriminator |
||
97 | * |
||
98 | * @throws CannotGroupEmptyStructure |
||
99 | * |
||
100 | * @return Map<mixed, Sequence<T>> |
||
101 | */ |
||
102 | public function groupBy(callable $discriminator): Map; |
||
103 | |||
104 | /** |
||
105 | * Return the first element |
||
106 | * |
||
107 | * @return T |
||
108 | */ |
||
109 | public function first(); |
||
110 | |||
111 | /** |
||
112 | * Return the last element |
||
113 | * |
||
114 | * @return T |
||
115 | */ |
||
116 | public function last(); |
||
117 | |||
118 | /** |
||
119 | * Check if the sequence contains the given element |
||
120 | * |
||
121 | * @param T $element |
||
122 | */ |
||
123 | public function contains($element): bool; |
||
124 | |||
125 | /** |
||
126 | * Return the index for the given element |
||
127 | * |
||
128 | * @param T $element |
||
129 | * |
||
130 | * @throws ElementNotFound |
||
131 | */ |
||
132 | public function indexOf($element): int; |
||
133 | |||
134 | /** |
||
135 | * Return the list of indices |
||
136 | * |
||
137 | * @return self<int> |
||
138 | */ |
||
139 | public function indices(): self; |
||
140 | |||
141 | /** |
||
142 | * Return a new sequence by applying the given function to all elements |
||
143 | * |
||
144 | * @param callable(T): T $function |
||
145 | * |
||
146 | * @return self<T> |
||
147 | */ |
||
148 | public function map(callable $function): self; |
||
149 | |||
150 | /** |
||
151 | * Pad the sequence to a defined size with the given element |
||
152 | * |
||
153 | * @param T $element |
||
154 | * |
||
155 | * @return self<T> |
||
156 | */ |
||
157 | public function pad(int $size, $element): self; |
||
158 | |||
159 | /** |
||
160 | * Return a sequence of 2 sequences partitioned according to the given predicate |
||
161 | * |
||
162 | * @param callable(T): bool $predicate |
||
163 | * |
||
164 | * @return Map<bool, Sequence<T>> |
||
165 | */ |
||
166 | public function partition(callable $predicate): Map; |
||
167 | |||
168 | /** |
||
169 | * Slice the sequence |
||
170 | * |
||
171 | * @return self<T> |
||
172 | */ |
||
173 | public function slice(int $from, int $until): self; |
||
174 | |||
175 | /** |
||
176 | * Split the sequence in a sequence of 2 sequences splitted at the given position |
||
177 | * |
||
178 | * @throws OutOfBoundException |
||
179 | * |
||
180 | * @return Sequence<Sequence<T>> |
||
181 | */ |
||
182 | public function splitAt(int $position): Sequence; |
||
183 | |||
184 | /** |
||
185 | * Return a sequence with the n first elements |
||
186 | * |
||
187 | * @return self<T> |
||
188 | */ |
||
189 | public function take(int $size): self; |
||
190 | |||
191 | /** |
||
192 | * Return a sequence with the n last elements |
||
193 | * |
||
194 | * @return self<T> |
||
195 | */ |
||
196 | public function takeEnd(int $size): self; |
||
197 | |||
198 | /** |
||
199 | * Append the given sequence to the current one |
||
200 | * |
||
201 | * @param self<T> $sequence |
||
202 | * |
||
203 | * @return self<T> |
||
204 | */ |
||
205 | public function append(self $sequence): self; |
||
206 | |||
207 | /** |
||
208 | * Return a sequence with all elements from the current one that exist |
||
209 | * in the given one |
||
210 | * |
||
211 | * @param self<T> $sequence |
||
212 | * |
||
213 | * @return self<T> |
||
214 | */ |
||
215 | public function intersect(self $sequence): self; |
||
216 | |||
217 | /** |
||
218 | * Concatenate all elements with the given separator |
||
219 | */ |
||
220 | public function join(string $separator): Str; |
||
221 | |||
222 | /** |
||
223 | * Add the given element at the end of the sequence |
||
224 | * |
||
225 | * @param T $element |
||
226 | * |
||
227 | * @return self<T> |
||
228 | */ |
||
229 | public function add($element): self; |
||
230 | |||
231 | /** |
||
232 | * Sort the sequence in a different order |
||
233 | * |
||
234 | * @param callable(T, T): int $function |
||
235 | * |
||
236 | * @return self<T> |
||
237 | */ |
||
238 | public function sort(callable $function): self; |
||
239 | |||
240 | /** |
||
241 | * Reduce the sequence to a single value |
||
242 | * |
||
243 | * @param mixed $carry |
||
244 | * @param callable(mixed, T) $reducer |
||
245 | * |
||
246 | * @return mixed |
||
247 | */ |
||
248 | public function reduce($carry, callable $reducer); |
||
249 | |||
250 | /** |
||
251 | * Return a set of the same type but without any value |
||
252 | * |
||
253 | * @return self<T> |
||
254 | */ |
||
255 | public function clear(): self; |
||
256 | |||
257 | /** |
||
258 | * Return the same sequence but in reverse order |
||
259 | * |
||
260 | * @return self<T> |
||
261 | */ |
||
262 | public function reverse(): self; |
||
263 | |||
264 | public function empty(): bool; |
||
265 | } |
||
266 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths