1 | <?php |
||
23 | class Fetch implements \IteratorAggregate |
||
24 | { |
||
25 | const DEFAULT_CHUNK_SIZE = 1000; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | private $chunk = self::DEFAULT_CHUNK_SIZE; |
||
31 | |||
32 | /** |
||
33 | * @var Builder |
||
34 | */ |
||
35 | private $builder; |
||
36 | |||
37 | /** |
||
38 | * Fetch constructor. |
||
39 | * @param Builder $builder |
||
40 | * @param int $chunk |
||
41 | */ |
||
42 | public function __construct(Builder $builder, $chunk = self::DEFAULT_CHUNK_SIZE) |
||
47 | |||
48 | /** |
||
49 | * @return \Generator |
||
50 | */ |
||
51 | public function getIterator() |
||
66 | } |
||
67 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: