Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function chargeAmountForPayable( |
||
16 | Int $amount, |
||
17 | Model $payable, |
||
18 | String $description, |
||
19 | array $params = [] |
||
20 | ) : Payment { |
||
21 | $payment = $payable->payments()->create([ |
||
22 | 'amount' => $amount, |
||
23 | 'status' => 'open', |
||
24 | 'description' => $description, |
||
25 | 'redirect_url' => 'https://www.fake-payment-gateway-url.com/?ref=123456', |
||
26 | 'return_url' => $params['return_url'], |
||
27 | 'gateway_name' => $this->getGatewayName(), |
||
28 | 'gateway_payment_reference' => 'fake-reference', |
||
29 | ]); |
||
30 | |||
31 | return $payment; |
||
32 | } |
||
33 | |||
54 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.