Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
18 | public function initiatePush(StkRequest $request) |
||
19 | { |
||
20 | try { |
||
21 | $stk = STK::request($request->amount) |
||
|
|||
22 | ->from($request->phone) |
||
23 | ->usingReference($request->reference, $request->description) |
||
24 | ->push(); |
||
25 | } catch (\Exception $exception) { |
||
26 | $stk = ['ResponseCode' => 900, 'ResponseDescription' => 'Invalid request', 'extra' => $exception->getMessage()]; |
||
27 | } |
||
28 | return response()->json($stk); |
||
29 | } |
||
30 | |||
40 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.