Skip to content

Commit 077fd5e

Browse files
committed
Fix more generic types
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent 68e5c6f commit 077fd5e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Data/Bundle/Reader/BufferedBundleReader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
class BufferedBundleReader implements BundleReaderInterface
2222
{
2323
private $reader;
24+
/** @var RingBuffer<string, mixed> */
2425
private $buffer;
2526

2627
/**

Data/Util/RingBuffer.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,23 @@
2222
*
2323
* @author Bernhard Schussek <bschussek@gmail.com>
2424
*
25+
* @template TKey of array-key
26+
* @template TValue
27+
*
28+
* @implements \ArrayAccess<TKey, TValue>
29+
*
2530
* @internal
2631
*/
2732
class RingBuffer implements \ArrayAccess
2833
{
34+
/**
35+
* @var array<int, TValue>
36+
*/
2937
private $values = [];
3038

39+
/**
40+
* @var array<TKey, int>
41+
*/
3142
private $indices = [];
3243

3344
private $cursor = 0;
@@ -50,7 +61,7 @@ public function offsetExists($key): bool
5061
/**
5162
* {@inheritdoc}
5263
*
53-
* @return mixed
64+
* @return TValue
5465
*/
5566
#[\ReturnTypeWillChange]
5667
public function offsetGet($key)

0 commit comments

Comments
 (0)