| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | private function loadConfigs($directory) |
||
| 44 | { |
||
| 45 | if (File::isDirectory($directory)) { |
||
| 46 | |||
| 47 | $files = File::allFiles($directory); |
||
| 48 | |||
| 49 | foreach ($files as $file) { |
||
| 50 | // build the key from the file name (just remove the .php extension from the file name) |
||
| 51 | $fileNameOnly = str_replace('.php', '', $file->getFilename()); |
||
| 52 | |||
| 53 | // merge the config file |
||
| 54 | $this->mergeConfigFrom($file->getPathname(), $fileNameOnly); |
||
|
|
|||
| 55 | } |
||
| 56 | } |
||
| 57 | } |
||
| 58 | } |
||
| 59 |
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.