| 1 | <?php |
||
| 11 | class ImportRecord extends Job |
||
| 12 | { |
||
| 13 | protected $record; |
||
| 14 | protected $collection; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * ImportRecord constructor. |
||
| 18 | * @param Collection $collection |
||
| 19 | * @param string $record |
||
| 20 | */ |
||
| 21 | public function __construct(Collection $collection, string $record) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param Marc21Importer $importer |
||
| 29 | */ |
||
| 30 | public function handle(DocumentsIndex $docIndex, Marc21Importer $importer) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param DocumentsIndex $docIndex |
||
| 39 | * @param int $docId |
||
| 40 | */ |
||
| 41 | public function imported($docIndex, $docId) |
||
| 52 | } |
||
| 53 |
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: