| 1 | <?php |
||
| 13 | trait CryptKeysTrait |
||
| 14 | { |
||
| 15 | 2 | public function registerCryptKeys() |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @param $return |
||
| 27 | * @return array |
||
| 28 | */ |
||
| 29 | protected function appendCryptKeysToProvide($return) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Create a CryptKey instance without permissions check |
||
| 38 | * |
||
| 39 | * @param $type |
||
| 40 | * @return \League\OAuth2\Server\CryptKey |
||
| 41 | */ |
||
| 42 | 2 | protected function makeCryptKey($type) |
|
| 46 | } |
||
| 47 |
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
Idableprovides a methodequalsIdthat 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.