1 | <?php |
||
24 | trait TokenProviderAttributeTrait |
||
25 | { |
||
26 | /** |
||
27 | * The provider(s) that the resulting must have. |
||
28 | * |
||
29 | * @var string|string[]|int|int[]|ProviderRecord|ProviderRecord[]|AbstractProvider|AbstractProvider[]|null |
||
30 | */ |
||
31 | public $provider; |
||
32 | |||
33 | /** |
||
34 | * @param string|string[]|int|int[]|ProviderRecord|ProviderRecord[]|AbstractProvider|AbstractProvider[]|null $value |
||
35 | * @return static The query object |
||
36 | */ |
||
37 | public function setProvider($value) |
||
42 | |||
43 | /** |
||
44 | * @param string|string[]|int|int[]|ProviderRecord|ProviderRecord[]|AbstractProvider|AbstractProvider[]|null $value |
||
45 | * @return static The query object |
||
46 | */ |
||
47 | public function provider($value) |
||
51 | |||
52 | /** |
||
53 | * @param string|string[]|int|int[]|ProviderRecord|ProviderRecord[]|AbstractProvider|AbstractProvider[]|null $value |
||
54 | * @return static The query object |
||
55 | */ |
||
56 | public function setProviderId($value) |
||
60 | |||
61 | /** |
||
62 | * @param string|string[]|int|int[]|ProviderRecord|ProviderRecord[]|AbstractProvider|AbstractProvider[]|null $value |
||
63 | * @return static The query object |
||
64 | */ |
||
65 | public function providerId($value) |
||
69 | |||
70 | /** |
||
71 | * @param $value |
||
72 | * @return array|string |
||
73 | * @throws QueryAbortedException |
||
74 | * @throws \ReflectionException |
||
75 | */ |
||
76 | protected function parseProviderValue($value) |
||
100 | |||
101 | /** |
||
102 | * @throws QueryAbortedException |
||
103 | * @throws \ReflectionException |
||
104 | */ |
||
105 | protected function applyProviderConditions() |
||
115 | } |
||
116 |
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.