Innmind /
Immutable
| 1 | <?php |
||
| 2 | declare(strict_types = 1); |
||
| 3 | |||
| 4 | namespace Innmind\Immutable\Map; |
||
| 5 | |||
| 6 | use Innmind\Immutable\{ |
||
| 7 | Map, |
||
| 8 | Str, |
||
| 9 | Set, |
||
| 10 | Sequence, |
||
| 11 | Pair, |
||
| 12 | Maybe, |
||
| 13 | SideEffect, |
||
| 14 | }; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @template T |
||
| 18 | * @template S |
||
| 19 | * @internal Dot not code against this interface |
||
| 20 | * @psalm-immutable |
||
| 21 | */ |
||
| 22 | interface Implementation extends \Countable |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * Set a new key/value pair |
||
| 26 | * |
||
| 27 | * @param T $key |
||
| 28 | * @param S $value |
||
|
0 ignored issues
–
show
|
|||
| 29 | * |
||
| 30 | * @return self<T, S> |
||
| 31 | */ |
||
| 32 | public function __invoke($key, $value): self; |
||
| 33 | |||
| 34 | public function size(): int; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Return the element with the given key |
||
| 38 | * |
||
| 39 | * @param T $key |
||
| 40 | * |
||
| 41 | * @return Maybe<S> |
||
| 42 | */ |
||
| 43 | public function get($key): Maybe; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Check if there is an element for the given key |
||
| 47 | * |
||
| 48 | * @param T $key |
||
| 49 | */ |
||
| 50 | public function contains($key): bool; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Return an empty map given the same given type |
||
| 54 | * |
||
| 55 | * @return self<T, S> |
||
| 56 | */ |
||
| 57 | public function clear(): self; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Check if the two maps are equal |
||
| 61 | * |
||
| 62 | * @param self<T, S> $map |
||
| 63 | */ |
||
| 64 | public function equals(self $map): bool; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Filter the map based on the given predicate |
||
| 68 | * |
||
| 69 | * @param callable(T, S): bool $predicate |
||
| 70 | * |
||
| 71 | * @return self<T, S> |
||
| 72 | */ |
||
| 73 | public function filter(callable $predicate): self; |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Run the given function for each element of the map |
||
| 77 | * |
||
| 78 | * @param callable(T, S): void $function |
||
| 79 | */ |
||
| 80 | public function foreach(callable $function): SideEffect; |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Return a new map of pairs' sequences grouped by keys determined with the given |
||
| 84 | * discriminator function |
||
| 85 | * |
||
| 86 | * @template D |
||
| 87 | * |
||
| 88 | * @param callable(T, S): D $discriminator |
||
| 89 | * |
||
| 90 | * @return Map<D, Map<T, S>> |
||
| 91 | */ |
||
| 92 | public function groupBy(callable $discriminator): Map; |
||
| 93 | |||
| 94 | /** |
||
| 95 | * Return all keys |
||
| 96 | * |
||
| 97 | * @return Set<T> |
||
| 98 | */ |
||
| 99 | public function keys(): Set; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Return all values |
||
| 103 | * |
||
| 104 | * @return Sequence<S> |
||
| 105 | */ |
||
| 106 | public function values(): Sequence; |
||
| 107 | |||
| 108 | /** |
||
| 109 | * Apply the given function on all elements and return a new map |
||
| 110 | * |
||
| 111 | * @template B |
||
| 112 | * |
||
| 113 | * @param callable(T, S): B $function |
||
| 114 | * |
||
| 115 | * @return self<T, B> |
||
| 116 | */ |
||
| 117 | public function map(callable $function): self; |
||
| 118 | |||
| 119 | /** |
||
| 120 | * Remove the element with the given key |
||
| 121 | * |
||
| 122 | * @param T $key |
||
| 123 | * |
||
| 124 | * @return self<T, S> |
||
| 125 | */ |
||
| 126 | public function remove($key): self; |
||
| 127 | |||
| 128 | /** |
||
| 129 | * Create a new map by combining both maps |
||
| 130 | * |
||
| 131 | * @param self<T, S> $map |
||
| 132 | * |
||
| 133 | * @return self<T, S> |
||
| 134 | */ |
||
| 135 | public function merge(self $map): self; |
||
| 136 | |||
| 137 | /** |
||
| 138 | * Return a map of 2 maps partitioned according to the given predicate |
||
| 139 | * |
||
| 140 | * @param callable(T, S): bool $predicate |
||
| 141 | * |
||
| 142 | * @return Map<bool, Map<T, S>> |
||
| 143 | */ |
||
| 144 | public function partition(callable $predicate): Map; |
||
| 145 | |||
| 146 | /** |
||
| 147 | * Reduce the map to a single value |
||
| 148 | * |
||
| 149 | * @template R |
||
| 150 | * @param R $carry |
||
|
0 ignored issues
–
show
The type
Innmind\Immutable\Map\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 Loading history...
|
|||
| 151 | * @param callable(R, T, S): R $reducer |
||
| 152 | * |
||
| 153 | * @return R |
||
| 154 | */ |
||
| 155 | public function reduce($carry, callable $reducer); |
||
| 156 | |||
| 157 | public function empty(): bool; |
||
| 158 | |||
| 159 | /** |
||
| 160 | * @param callable(T, S): bool $predicate |
||
| 161 | * |
||
| 162 | * @return Maybe<Pair<T, S>> |
||
| 163 | */ |
||
| 164 | public function find(callable $predicate): Maybe; |
||
| 165 | } |
||
| 166 |
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