1 | <?php |
||
15 | trait Parameters |
||
16 | { |
||
17 | /** |
||
18 | * Trả về giá trị merchant id do OnePay cấp. |
||
19 | * |
||
20 | * @return null|string |
||
21 | */ |
||
22 | public function getVpcMerchant(): ?string |
||
26 | |||
27 | /** |
||
28 | * Thiết lập giá trị merchant id. |
||
29 | * |
||
30 | * @param null|string $merchant |
||
31 | * @return $this |
||
32 | */ |
||
33 | public function setVpcMerchant(?string $merchant) |
||
37 | |||
38 | /** |
||
39 | * Trả về giá trị access code do OnePay cấp. |
||
40 | * |
||
41 | * @return null|string |
||
42 | */ |
||
43 | public function getVpcAccessCode(): ?string |
||
47 | |||
48 | /** |
||
49 | * Thiết lập giá trị access code. |
||
50 | * |
||
51 | * @param null|string $code |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function setVpcAccessCode(?string $code) |
||
58 | |||
59 | /** |
||
60 | * Trả về giá trị hash key do OnePay cấp. |
||
61 | * |
||
62 | * @return null|string |
||
63 | */ |
||
64 | public function getVpcHashKey(): ?string |
||
68 | |||
69 | /** |
||
70 | * Thiết lập giá trị hash key dùng để tạo chữ ký dữ liệu (secure hash). |
||
71 | * |
||
72 | * @param null|string $key |
||
73 | * @return $this |
||
74 | */ |
||
75 | public function setVpcHashKey(?string $key) |
||
79 | |||
80 | /** |
||
81 | * Trả về giá trị user do OnePay cấp. |
||
82 | * |
||
83 | * @return null|string |
||
84 | */ |
||
85 | public function getVpcUser(): ?string |
||
89 | |||
90 | /** |
||
91 | * Thiết lập giá trị user. |
||
92 | * |
||
93 | * @param null|string $user |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function setVpcUser(?string $user) |
||
100 | |||
101 | /** |
||
102 | * Trả về giá trị password do OnePay cấp. |
||
103 | * |
||
104 | * @return null|string |
||
105 | */ |
||
106 | public function getVpcPassword(): ?string |
||
110 | |||
111 | /** |
||
112 | * Thiết lập giá trị password. |
||
113 | * |
||
114 | * @param null|string $password |
||
115 | * @return $this |
||
116 | */ |
||
117 | public function setVpcPassword(?string $password) |
||
121 | |||
122 | /** |
||
123 | * Trả về giá trị version hiện tại. |
||
124 | * |
||
125 | * @return null|string |
||
126 | */ |
||
127 | public function getVpcVersion(): ?string |
||
131 | |||
132 | /** |
||
133 | * Thiết lập giá trị version muốn sử dụng. |
||
134 | * |
||
135 | * @param null|string $version |
||
136 | * @return $this |
||
137 | */ |
||
138 | public function setVpcVersion(?string $version) |
||
142 | } |
||
143 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.