Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | private function loadConfig() |
||
21 | { |
||
22 | $configPath = __DIR__ . '/../Tools/Patches/patches.yml'; |
||
23 | |||
24 | $this->config = Yaml::parse( |
||
25 | file_get_contents($configPath) |
||
26 | ); |
||
27 | |||
28 | if ($this->config['patches'] == null) { |
||
29 | $this->config['patches'] = []; |
||
30 | } |
||
31 | |||
32 | $this->config['paths'] = [ |
||
33 | 'patchFilesDir' => __DIR__ . '/../Tools/Patches/patches', |
||
34 | 'rootDir' => str_replace('/app/..', '', $this->getContainer()->getParameter('kernel.root_dir') . '/..'), |
||
|
|||
35 | 'configFile' => $configPath, |
||
36 | ]; |
||
37 | } |
||
38 | } |
||
39 |
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.