1
|
|
|
<?php |
2
|
|
|
declare(strict_types = 1); |
3
|
|
|
|
4
|
|
|
namespace Innmind\Immutable\Map; |
5
|
|
|
|
6
|
|
|
use Innmind\Immutable\{ |
7
|
|
|
Map, |
8
|
|
|
Sequence, |
9
|
|
|
Set, |
10
|
|
|
Pair, |
11
|
|
|
Maybe, |
12
|
|
|
SideEffect, |
13
|
|
|
}; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @template T |
17
|
|
|
* @template S |
18
|
|
|
* @psalm-immutable |
19
|
|
|
*/ |
20
|
|
|
final class Uninitialized implements Implementation |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @param T $key |
|
|
|
|
24
|
|
|
* @param S $value |
|
|
|
|
25
|
|
|
* |
26
|
|
|
* @return Implementation<T, S> |
27
|
|
|
*/ |
28
|
|
|
public function __invoke($key, $value): Implementation |
29
|
|
|
{ |
30
|
|
|
return self::open($key, $value); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @template A |
35
|
|
|
* @template B |
36
|
|
|
* @psalm-pure |
37
|
|
|
* |
38
|
|
|
* @param A $key |
|
|
|
|
39
|
|
|
* @param B $value |
|
|
|
|
40
|
|
|
* |
41
|
|
|
* @return Implementation<A, B> |
42
|
|
|
*/ |
43
|
|
|
public static function open($key, $value): Implementation |
44
|
|
|
{ |
45
|
|
|
return ObjectKeys::of($key, $value) |
46
|
|
|
->otherwise(static fn() => Primitive::of($key, $value)) |
47
|
|
|
->match( |
48
|
|
|
static fn($implementation) => $implementation, |
49
|
|
|
static fn() => DoubleIndex::of($key, $value), |
50
|
|
|
); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function size(): int |
54
|
|
|
{ |
55
|
|
|
return 0; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function count(): int |
59
|
|
|
{ |
60
|
|
|
return $this->size(); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @param T $key |
65
|
|
|
* |
66
|
|
|
* @return Maybe<S> |
67
|
|
|
*/ |
68
|
|
|
public function get($key): Maybe |
69
|
|
|
{ |
70
|
|
|
return Maybe::nothing(); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @param T $key |
75
|
|
|
*/ |
76
|
|
|
public function contains($key): bool |
77
|
|
|
{ |
78
|
|
|
return false; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @return self<T, S> |
83
|
|
|
*/ |
84
|
|
|
public function clear(): self |
85
|
|
|
{ |
86
|
|
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param Implementation<T, S> $map |
91
|
|
|
*/ |
92
|
|
|
public function equals(Implementation $map): bool |
93
|
|
|
{ |
94
|
|
|
return $map->empty(); |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param callable(T, S): bool $predicate |
99
|
|
|
* |
100
|
|
|
* @return self<T, S> |
101
|
|
|
*/ |
102
|
|
|
public function filter(callable $predicate): self |
103
|
|
|
{ |
104
|
|
|
return $this; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @param callable(T, S): void $function |
109
|
|
|
*/ |
110
|
|
|
public function foreach(callable $function): SideEffect |
111
|
|
|
{ |
112
|
|
|
return new SideEffect; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @template D |
117
|
|
|
* |
118
|
|
|
* @param callable(T, S): D $discriminator |
119
|
|
|
* |
120
|
|
|
* @return Map<D, Map<T, S>> |
121
|
|
|
*/ |
122
|
|
|
public function groupBy(callable $discriminator): Map |
123
|
|
|
{ |
124
|
|
|
/** @var Map<D, Map<T, S>> */ |
125
|
|
|
return Map::of(); |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @return Set<T> |
130
|
|
|
*/ |
131
|
|
|
public function keys(): Set |
132
|
|
|
{ |
133
|
|
|
/** @var Set<T> */ |
134
|
|
|
return Set::of(); |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @return Sequence<S> |
139
|
|
|
*/ |
140
|
|
|
public function values(): Sequence |
141
|
|
|
{ |
142
|
|
|
/** @var Sequence<S> */ |
143
|
|
|
return Sequence::of(); |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @template B |
148
|
|
|
* |
149
|
|
|
* @param callable(T, S): B $function |
150
|
|
|
* |
151
|
|
|
* @return self<T, B> |
152
|
|
|
*/ |
153
|
|
|
public function map(callable $function): self |
154
|
|
|
{ |
155
|
|
|
return new self; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @param T $key |
160
|
|
|
* |
161
|
|
|
* @return self<T, S> |
162
|
|
|
*/ |
163
|
|
|
public function remove($key): self |
164
|
|
|
{ |
165
|
|
|
return $this; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @param Implementation<T, S> $map |
170
|
|
|
* |
171
|
|
|
* @return Implementation<T, S> |
172
|
|
|
*/ |
173
|
|
|
public function merge(Implementation $map): Implementation |
174
|
|
|
{ |
175
|
|
|
return $map; |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
/** |
179
|
|
|
* @param callable(T, S): bool $predicate |
180
|
|
|
* |
181
|
|
|
* @return Map<bool, Map<T, S>> |
182
|
|
|
*/ |
183
|
|
|
public function partition(callable $predicate): Map |
184
|
|
|
{ |
185
|
|
|
return Map::of( |
186
|
|
|
[true, $this->clearMap()], |
187
|
|
|
[false, $this->clearMap()], |
188
|
|
|
); |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* @template R |
193
|
|
|
* @param R $carry |
|
|
|
|
194
|
|
|
* @param callable(R, T, S): R $reducer |
195
|
|
|
* |
196
|
|
|
* @return R |
197
|
|
|
*/ |
198
|
|
|
public function reduce($carry, callable $reducer) |
199
|
|
|
{ |
200
|
|
|
return $carry; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
public function empty(): bool |
204
|
|
|
{ |
205
|
|
|
return true; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
public function find(callable $predicate): Maybe |
209
|
|
|
{ |
210
|
|
|
/** @var Maybe<Pair<T, S>> */ |
211
|
|
|
return Maybe::nothing(); |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* @return Map<T, S> |
216
|
|
|
*/ |
217
|
|
|
private function clearMap(): Map |
218
|
|
|
{ |
219
|
|
|
return Map::of(); |
220
|
|
|
} |
221
|
|
|
} |
222
|
|
|
|
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