1 | <?php |
||
16 | class Transaction |
||
17 | { |
||
18 | /** |
||
19 | * @var |
||
20 | */ |
||
21 | private $from, $to, $value, $currency, $to_params, $token, $fee, $from_params, $saved_customer, $transfers = []; |
||
22 | |||
23 | /** |
||
24 | * Transaction constructor. |
||
25 | * @param null $token |
||
26 | */ |
||
27 | public function __construct($token = null) |
||
31 | |||
32 | /** |
||
33 | * Set the Customer. |
||
34 | * |
||
35 | * @param $user |
||
36 | * @param array $params |
||
37 | * @return $this |
||
38 | */ |
||
39 | public function from($user, $params = []) |
||
45 | |||
46 | /** |
||
47 | * @return $this |
||
48 | */ |
||
49 | public function useSavedCustomer() |
||
54 | |||
55 | /** |
||
56 | * Set the Vendor. |
||
57 | * |
||
58 | * @param $user |
||
59 | * @param array $params |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function to($user, $params = []) |
||
68 | |||
69 | /** |
||
70 | * The amount of the transaction. |
||
71 | * |
||
72 | * @param $value |
||
73 | * @param $currency |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function amount($value, $currency) |
||
82 | |||
83 | /** |
||
84 | * Take your fees here. |
||
85 | * |
||
86 | * @param $amount |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function fee($amount) |
||
94 | |||
95 | /** |
||
96 | * Transfer an amount from the charge to someone. |
||
97 | * |
||
98 | * @param $amount |
||
99 | * @param $receiver |
||
100 | * @param $currency |
||
101 | * @param $receiver_params |
||
102 | * @return $this |
||
103 | */ |
||
104 | public function transfer($amount, $receiver, $currency = null, $receiver_params = []) |
||
115 | |||
116 | /** |
||
117 | * Create the transaction: charge customer and credit vendor. |
||
118 | * This function saves the two accounts. |
||
119 | * |
||
120 | * @param array $params |
||
121 | * @return Charge |
||
122 | */ |
||
123 | public function create($params = []) |
||
159 | } |
||
160 |
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.