We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 4 |
Paths | 5 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 80 | public function getFields() |
|
28 | { |
||
29 | 80 | if (null === $this->_fields) { |
|
30 | 37 | $fields = isset($this->config['fields']) ? $this->config['fields'] : []; |
|
|
|||
31 | 37 | $fields = is_callable($fields) ? call_user_func($fields) : $fields; |
|
32 | 37 | $this->_fields = FieldDefinition::createMap($fields); |
|
33 | 37 | } |
|
34 | |||
35 | 80 | return $this->_fields; |
|
36 | } |
||
37 | |||
55 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: