1 | <?php namespace Arcanesoft\Core\Helpers\UI\LinkTraits; |
||
9 | trait ActivateLinks |
||
10 | { |
||
11 | /** |
||
12 | * Generate activate icon link. |
||
13 | * |
||
14 | * @param bool $active |
||
15 | * @param string $url |
||
16 | * @param array $attributes |
||
17 | * @param bool $disabled |
||
18 | * |
||
19 | * @return self |
||
20 | */ |
||
21 | 18 | public static function activateIcon($active, $url, array $attributes = [], $disabled = false) |
|
28 | |||
29 | /** |
||
30 | * Generate activate icon link for modals (reverse button based on active state). |
||
31 | * |
||
32 | * @param bool $active |
||
33 | * @param string $url |
||
34 | * @param array $attributes |
||
35 | * @param bool $disabled |
||
36 | * |
||
37 | * @return self |
||
38 | */ |
||
39 | 3 | public static function activateModalIcon($active, $url, array $attributes = [], $disabled = false) |
|
50 | |||
51 | /** |
||
52 | * Generate activate link with icon for modals (reverse button based on active state). |
||
53 | * |
||
54 | * @param bool $active |
||
55 | * @param string $url |
||
56 | * @param array $attributes |
||
57 | * @param bool $disabled |
||
58 | * |
||
59 | * @return self |
||
60 | */ |
||
61 | 3 | public static function activateModalWithIcon($active, $url, array $attributes = [], $disabled = false) |
|
75 | } |
||
76 |
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.