Conditions | 6 |
Paths | 32 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
16 | 14 | public function readConfig($action) |
|
17 | { |
||
18 | 14 | $this->fieldsPresentation = $this->getConfigValue('fields_presentation') ?: []; |
|
|
|||
19 | 14 | $this->formTypes = $this->getConfigValue($action, 'form_types') ?: []; |
|
20 | 14 | $this->validationRules = $this->getConfigValue($action, 'validation') ?: []; |
|
21 | 14 | $this->functions = $this->getConfigValue($action, 'functions') ?: []; |
|
22 | 14 | $this->defaults = $this->getConfigValue($action, 'defaults') ?: []; |
|
23 | 14 | } |
|
24 | |||
52 |
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.