| Conditions | 2 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function run(string $data) |
||
| 33 | { |
||
| 34 | try { |
||
| 35 | $payload = FileUpload::decodeServerOptions($data); |
||
| 36 | $fileHandler = new RemoveHandler(); |
||
| 37 | |||
| 38 | return $this->controller->asJson($fileHandler->remove($payload['uploader'], $payload['userData'])); |
||
|
|
|||
| 39 | } catch (Exception $e) { |
||
| 40 | $response = Yii::$app->response; |
||
| 41 | $response->format = Response::FORMAT_RAW; |
||
| 42 | $response->setStatusCode($e->getCode(), $e->getMessage()); |
||
| 43 | |||
| 44 | Yii::error(LoggerMessage::log($e), __METHOD__); |
||
| 45 | |||
| 46 | return $response; |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 50 |
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: