File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -226,11 +226,11 @@ public function toIterableValue(): IterableValue
226
226
}
227
227
228
228
/**
229
- * @phpstan-return IterableValue<TValue , TKey>
229
+ * @phpstan-return AssocValue<int|string , TKey>
230
230
*/
231
- public function flip (): IterableValue
231
+ public function flip (): AssocValue
232
232
{
233
- return $ this ->toIterableValue ()-> flip ( );
233
+ return new self ( new Flip ( $ this ->items ) );
234
234
}
235
235
236
236
/**
Original file line number Diff line number Diff line change @@ -145,9 +145,9 @@ public function only(...$keys): AssocValue;
145
145
public function withoutElement ($ value ): AssocValue ;
146
146
147
147
/**
148
- * @phpstan-return IterableValue<TValue , TKey>
148
+ * @phpstan-return AssocValue<int|string , TKey>
149
149
*/
150
- public function flip (): IterableValue ;
150
+ public function flip (): AssocValue ;
151
151
152
152
/**
153
153
* @param TKey $keyA
Original file line number Diff line number Diff line change 6
6
use function array_flip ;
7
7
8
8
/**
9
- * @template TKey of int|string
9
+ * @template TKey
10
10
* @template TValue of int|string
11
- * @implements Associable<TKey ,TValue>
11
+ * @implements Associable<int|string ,TValue>
12
12
*/
13
13
final class Flip implements Associable
14
14
{
@@ -23,7 +23,7 @@ public function __construct(Associable $associable)
23
23
$ this ->associable = $ associable ;
24
24
}
25
25
26
- /** @return array<TKey ,TValue> */
26
+ /** @return array<int|string ,TValue> */
27
27
public function toAssocArray (): array
28
28
{
29
29
return array_flip ($ this ->associable ->toAssocArray ());
You can’t perform that action at this time.
0 commit comments