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 | Set, |
||
11 | Maybe, |
||
12 | SideEffect, |
||
13 | }; |
||
14 | |||
15 | /** |
||
16 | * @template T |
||
17 | * @psalm-immutable |
||
18 | */ |
||
19 | interface Implementation extends \Countable |
||
20 | { |
||
21 | /** |
||
22 | * Add the given element at the end of the sequence |
||
23 | * |
||
24 | * @param T $element |
||
0 ignored issues
–
show
|
|||
25 | * |
||
26 | * @return self<T> |
||
27 | */ |
||
28 | public function __invoke($element): self; |
||
29 | |||
30 | public function size(): int; |
||
31 | |||
32 | /** |
||
33 | * @return \Iterator<int, T> |
||
34 | */ |
||
35 | public function iterator(): \Iterator; |
||
36 | |||
37 | /** |
||
38 | * Return the element at the given index |
||
39 | * |
||
40 | * @return Maybe<T> |
||
41 | */ |
||
42 | public function get(int $index): Maybe; |
||
43 | |||
44 | /** |
||
45 | * Return the diff between this sequence and another |
||
46 | * |
||
47 | * @param self<T> $sequence |
||
48 | * |
||
49 | * @return self<T> |
||
50 | */ |
||
51 | public function diff(self $sequence): self; |
||
52 | |||
53 | /** |
||
54 | * Remove all duplicates from the sequence |
||
55 | * |
||
56 | * @return self<T> |
||
57 | */ |
||
58 | public function distinct(): self; |
||
59 | |||
60 | /** |
||
61 | * Remove the n first elements |
||
62 | * |
||
63 | * @return self<T> |
||
64 | */ |
||
65 | public function drop(int $size): self; |
||
66 | |||
67 | /** |
||
68 | * Remove the n last elements |
||
69 | * |
||
70 | * @return self<T> |
||
71 | */ |
||
72 | public function dropEnd(int $size): self; |
||
73 | |||
74 | /** |
||
75 | * Check if the two sequences are equal |
||
76 | * |
||
77 | * @param self<T> $sequence |
||
78 | */ |
||
79 | public function equals(self $sequence): bool; |
||
80 | |||
81 | /** |
||
82 | * Return all elements that satisfy the given predicate |
||
83 | * |
||
84 | * @param callable(T): bool $predicate |
||
85 | * |
||
86 | * @return self<T> |
||
87 | */ |
||
88 | public function filter(callable $predicate): self; |
||
89 | |||
90 | /** |
||
91 | * Apply the given function to all elements of the sequence |
||
92 | * |
||
93 | * @param callable(T): void $function |
||
94 | */ |
||
95 | public function foreach(callable $function): SideEffect; |
||
96 | |||
97 | /** |
||
98 | * Return a new map of pairs grouped by keys determined with the given |
||
99 | * discriminator function |
||
100 | * |
||
101 | * @template D |
||
102 | * @param callable(T): D $discriminator |
||
103 | * |
||
104 | * @return Map<D, Sequence<T>> |
||
105 | */ |
||
106 | public function groupBy(callable $discriminator): Map; |
||
107 | |||
108 | /** |
||
109 | * Return the first element |
||
110 | * |
||
111 | * @return Maybe<T> |
||
112 | */ |
||
113 | public function first(): Maybe; |
||
114 | |||
115 | /** |
||
116 | * Return the last element |
||
117 | * |
||
118 | * @return Maybe<T> |
||
119 | */ |
||
120 | public function last(): Maybe; |
||
121 | |||
122 | /** |
||
123 | * Check if the sequence contains the given element |
||
124 | * |
||
125 | * @param T $element |
||
126 | */ |
||
127 | public function contains($element): bool; |
||
128 | |||
129 | /** |
||
130 | * Return the index for the given element |
||
131 | * |
||
132 | * @param T $element |
||
133 | * |
||
134 | * @return Maybe<int> |
||
135 | */ |
||
136 | public function indexOf($element): Maybe; |
||
137 | |||
138 | /** |
||
139 | * Return the list of indices |
||
140 | * |
||
141 | * @return self<int> |
||
142 | */ |
||
143 | public function indices(): self; |
||
144 | |||
145 | /** |
||
146 | * Return a new sequence by applying the given function to all elements |
||
147 | * |
||
148 | * @template S |
||
149 | * |
||
150 | * @param callable(T): S $function |
||
151 | * |
||
152 | * @return self<S> |
||
153 | */ |
||
154 | public function map(callable $function): self; |
||
155 | |||
156 | /** |
||
157 | * @template S |
||
158 | * |
||
159 | * @param callable(T): Sequence<S> $map |
||
160 | * @param callable(Sequence<S>): self<S> $exfiltrate |
||
161 | * |
||
162 | * @return Sequence<S> |
||
163 | */ |
||
164 | public function flatMap(callable $map, callable $exfiltrate): Sequence; |
||
165 | |||
166 | /** |
||
167 | * Pad the sequence to a defined size with the given element |
||
168 | * |
||
169 | * @param T $element |
||
170 | * |
||
171 | * @return self<T> |
||
172 | */ |
||
173 | public function pad(int $size, $element): self; |
||
174 | |||
175 | /** |
||
176 | * Return a sequence of 2 sequences partitioned according to the given predicate |
||
177 | * |
||
178 | * @param callable(T): bool $predicate |
||
179 | * |
||
180 | * @return Map<bool, Sequence<T>> |
||
181 | */ |
||
182 | public function partition(callable $predicate): Map; |
||
183 | |||
184 | /** |
||
185 | * Slice the sequence |
||
186 | * |
||
187 | * @return self<T> |
||
188 | */ |
||
189 | public function slice(int $from, int $until): self; |
||
190 | |||
191 | /** |
||
192 | * Return a sequence with the n first elements |
||
193 | * |
||
194 | * @return self<T> |
||
195 | */ |
||
196 | public function take(int $size): self; |
||
197 | |||
198 | /** |
||
199 | * Return a sequence with the n last elements |
||
200 | * |
||
201 | * @return self<T> |
||
202 | */ |
||
203 | public function takeEnd(int $size): self; |
||
204 | |||
205 | /** |
||
206 | * Append the given sequence to the current one |
||
207 | * |
||
208 | * @param self<T> $sequence |
||
209 | * |
||
210 | * @return self<T> |
||
211 | */ |
||
212 | public function append(self $sequence): self; |
||
213 | |||
214 | /** |
||
215 | * Return a sequence with all elements from the current one that exist |
||
216 | * in the given one |
||
217 | * |
||
218 | * @param self<T> $sequence |
||
219 | * |
||
220 | * @return self<T> |
||
221 | */ |
||
222 | public function intersect(self $sequence): self; |
||
223 | |||
224 | /** |
||
225 | * Sort the sequence in a different order |
||
226 | * |
||
227 | * @param callable(T, T): int $function |
||
228 | * |
||
229 | * @return self<T> |
||
230 | */ |
||
231 | public function sort(callable $function): self; |
||
232 | |||
233 | /** |
||
234 | * Reduce the sequence to a single value |
||
235 | * |
||
236 | * @template R |
||
237 | * @param R $carry |
||
0 ignored issues
–
show
The type
Innmind\Immutable\Sequence\R was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
238 | * @param callable(R, T): R $reducer |
||
239 | * |
||
240 | * @return R |
||
241 | */ |
||
242 | public function reduce($carry, callable $reducer); |
||
243 | |||
244 | /** |
||
245 | * Return a set of the same type but without any value |
||
246 | * |
||
247 | * @return self<T> |
||
248 | */ |
||
249 | public function clear(): self; |
||
250 | |||
251 | /** |
||
252 | * Return the same sequence but in reverse order |
||
253 | * |
||
254 | * @return self<T> |
||
255 | */ |
||
256 | public function reverse(): self; |
||
257 | |||
258 | public function empty(): bool; |
||
259 | |||
260 | /** |
||
261 | * @return Sequence<T> |
||
262 | */ |
||
263 | public function toSequence(): Sequence; |
||
264 | |||
265 | /** |
||
266 | * @return Set<T> |
||
267 | */ |
||
268 | public function toSet(): Set; |
||
269 | |||
270 | /** |
||
271 | * @param callable(T): bool $predicate |
||
272 | * |
||
273 | * @return Maybe<T> |
||
274 | */ |
||
275 | public function find(callable $predicate): Maybe; |
||
276 | |||
277 | /** |
||
278 | * @template R |
||
279 | * |
||
280 | * @param callable(self<T>): Sequence<T> $wrap |
||
281 | * @param callable(T, Sequence<T>): R $match |
||
282 | * @param callable(): R $empty |
||
283 | * |
||
284 | * @return R |
||
285 | */ |
||
286 | public function match(callable $wrap, callable $match, callable $empty); |
||
287 | } |
||
288 |
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