1 | <?php |
||
15 | abstract class AbstractScaleEngineResponse implements ResponseClassInterface |
||
16 | { |
||
17 | /** |
||
18 | * Get the result of a command, throwing an error if it failed. |
||
19 | * |
||
20 | * All ScaleEngine API calls have a top-level `status` field that will be |
||
21 | * `success` for successful replies. This will throw an exception if the |
||
22 | * reply is not successful. |
||
23 | * |
||
24 | * @param OperationCommand $command The API call being executed. |
||
25 | * @param string|array $resultPath The path to the actual result model. If |
||
26 | * not provided, this will return the entire JSON response. |
||
27 | * @return array The top-level result JSON from the API call. |
||
28 | * @throws Exception if the result was not successful. |
||
29 | */ |
||
30 | public static function getResult(OperationCommand $command, $resultPath = []) |
||
39 | } |
||
40 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.