1 | <?php |
||
4 | trait Client |
||
5 | { |
||
6 | // Client.php |
||
7 | |||
8 | // Users.php |
||
9 | /** |
||
10 | * TODO: Add POST options |
||
11 | */ |
||
12 | public function clientUsersAdd() |
||
16 | |||
17 | public function clientUsersDelete($Hash) |
||
21 | |||
22 | /** |
||
23 | * TODO: Add POST options |
||
24 | */ |
||
25 | public function clientUsersSave($Hash) |
||
29 | |||
30 | /** |
||
31 | * TODO: Add POST options |
||
32 | */ |
||
33 | public function clientUsersImport($Hash) |
||
37 | |||
38 | public function clientUsersExport($Hash) |
||
42 | |||
43 | public function clientUsersGet($Hash) |
||
47 | |||
48 | 2 | public function clientUsersGetAll($start = 0, $limit = 25) |
|
52 | |||
53 | /** |
||
54 | * Keeping backwords compatibility of clientUsersGetAll() function |
||
55 | */ |
||
56 | public function clientGetAll($start = 0, $limit = 25) |
||
60 | } |
||
61 |
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.