1 | <?php |
||
14 | trait Parameters |
||
15 | { |
||
16 | /** |
||
17 | * Trả về access key do MoMo cấp. |
||
18 | * |
||
19 | * @return null|string |
||
20 | */ |
||
21 | public function getAccessKey(): ?string |
||
25 | |||
26 | /** |
||
27 | * Thiết lập access key do MoMo cấp. |
||
28 | * |
||
29 | * @param null|string $key |
||
30 | * @return $this |
||
31 | */ |
||
32 | public function setAccessKey(?string $key) |
||
36 | |||
37 | /** |
||
38 | * Trả về secret key do MoMo cấp. |
||
39 | * |
||
40 | * @return null|string |
||
41 | */ |
||
42 | public function getSecretKey(): ?string |
||
46 | |||
47 | /** |
||
48 | * Thiết lập secret key do MoMo cấp. |
||
49 | * |
||
50 | * @param null|string $key |
||
51 | * @return $this |
||
52 | */ |
||
53 | public function setSecretKey(?string $key) |
||
57 | |||
58 | /** |
||
59 | * Trả về partner code do MoMo cấp. |
||
60 | * |
||
61 | * @return null|string |
||
62 | */ |
||
63 | public function getPartnerCode(): ?string |
||
67 | |||
68 | /** |
||
69 | * Thiết lập partner code do MoMo cấp. |
||
70 | * |
||
71 | * @param null|string $code |
||
72 | * @return $this |
||
73 | */ |
||
74 | public function setPartnerCode(?string $code) |
||
78 | |||
79 | /** |
||
80 | * Trả về public key do MoMo cấp. |
||
81 | * |
||
82 | * @return null|string |
||
83 | */ |
||
84 | public function getPublicKey(): ?string |
||
88 | |||
89 | /** |
||
90 | * Thiết lập public key do MoMo cấp. |
||
91 | * |
||
92 | * @param null|string $key |
||
93 | * @return $this |
||
94 | */ |
||
95 | public function setPublicKey(?string $key) |
||
99 | } |
||
100 |
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.