1 | <?php |
||
7 | trait EmployerManagers |
||
8 | { |
||
9 | use ResolvesCurrentUser; |
||
10 | |||
11 | /** |
||
12 | * Reference types and the rights of the Manager |
||
13 | * @param string|bool $employerId |
||
14 | * @return array |
||
15 | */ |
||
16 | public function getManagerTypes($employerId = false) |
||
22 | |||
23 | /** |
||
24 | * Get employer managers |
||
25 | * |
||
26 | * @param string|bool $employerId default resolved from profile |
||
27 | * @return array |
||
28 | */ |
||
29 | public function getManagers($employerId = false) |
||
35 | |||
36 | /** |
||
37 | * Get manager information |
||
38 | * |
||
39 | * @param string $managerId |
||
40 | * @param string|bool $employerId default resolved from profile |
||
41 | * @return array |
||
42 | */ |
||
43 | public function getManager($managerId, $employerId = false) |
||
49 | |||
50 | /** |
||
51 | * @param string|bool $employerId default resolved from profile |
||
52 | * @return array |
||
53 | */ |
||
54 | public function getManagersWhoHasVacancies($employerId = false) |
||
64 | |||
65 | /** |
||
66 | * @param array $manager |
||
67 | * @return bool |
||
68 | */ |
||
69 | protected function hasVacancies(array $manager) |
||
73 | |||
74 | /** |
||
75 | * @param string|bool $employerId |
||
76 | * @return string |
||
77 | */ |
||
78 | protected function resolveEmployerId($employerId) |
||
85 | } |
||
86 |
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.