| 1 | <?php declare(strict_types=1); |
||
| 16 | class Gitlab implements RepositoryManager |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var \Gitlab\Client |
||
| 20 | */ |
||
| 21 | private $client; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Constructor. |
||
| 25 | */ |
||
| 26 | public function __construct() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Get the file contents. |
||
| 34 | * |
||
| 35 | * @param Project $project |
||
| 36 | * @param string $file |
||
| 37 | * |
||
| 38 | * @return array |
||
| 39 | */ |
||
| 40 | public function getFileContents(Project $project, string $file): array |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Parse JSON data. |
||
| 57 | * |
||
| 58 | * @param string $data |
||
| 59 | * |
||
| 60 | * @return mixed |
||
| 61 | */ |
||
| 62 | private function parseJson($data) |
||
| 74 | } |
||
| 75 |
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: