| Conditions | 5 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function handle(callable $callback): Response |
||
| 43 | { |
||
| 44 | $result = $callback->__invoke($this->getMessage(), [$this, 'fail'], [$this, 'alert']); |
||
|
|
|||
| 45 | |||
| 46 | $attributes = [ |
||
| 47 | 'result_code' => is_null($this->alert) && is_null($this->fail) ? static::SUCCESS : static::FAIL, |
||
| 48 | 'err_code_des' => $this->alert, |
||
| 49 | ]; |
||
| 50 | |||
| 51 | if (is_null($this->alert) && is_string($result)) { |
||
| 52 | $attributes += [ |
||
| 53 | 'appid' => $this->app['config']->app_id, |
||
| 54 | 'mch_id' => $this->app['config']->mch_id, |
||
| 55 | 'nonce_str' => uniqid(), |
||
| 56 | 'prepay_id' => $result, |
||
| 57 | ]; |
||
| 58 | } |
||
| 59 | |||
| 60 | return $this->respondWith($attributes, true)->toResponse(); |
||
| 61 | } |
||
| 62 | } |
||
| 63 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.