File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 12
12
use Tensor \Exceptions \DimensionalityMismatch ;
13
13
use Tensor \Exceptions \RuntimeException ;
14
14
use Tensor \Exceptions \NotImplemented ;
15
- use Generator ;
15
+ use Traversable ;
16
16
17
17
use function count ;
18
18
use function is_float ;
@@ -3435,7 +3435,7 @@ public function offsetGet($index) : Vector
3435
3435
*
3436
3436
* @return \Generator<int,\Tensor\Vector>
3437
3437
*/
3438
- public function getIterator () : Generator
3438
+ public function getIterator () : Traversable
3439
3439
{
3440
3440
foreach ($ this ->a as $ row ) {
3441
3441
yield Vector::quick ($ row );
Original file line number Diff line number Diff line change 6
6
use Tensor \Exceptions \DimensionalityMismatch ;
7
7
use Tensor \Exceptions \RuntimeException ;
8
8
use ArrayIterator ;
9
+ use Traversable ;
9
10
10
11
use function count ;
11
12
use function is_float ;
@@ -2303,6 +2304,7 @@ public function offsetUnset($index) : void
2303
2304
* @throws \Tensor\Exceptions\InvalidArgumentException
2304
2305
* @return float
2305
2306
*/
2307
+ #[\ReturnTypeWillChange]
2306
2308
public function offsetGet ($ index )
2307
2309
{
2308
2310
if (isset ($ this ->a [$ index ])) {
@@ -2318,7 +2320,7 @@ public function offsetGet($index)
2318
2320
*
2319
2321
* @return \ArrayIterator<int,float>
2320
2322
*/
2321
- public function getIterator () : ArrayIterator
2323
+ public function getIterator () : Traversable
2322
2324
{
2323
2325
return new ArrayIterator ($ this ->a );
2324
2326
}
You can’t perform that action at this time.
0 commit comments