| Conditions | 5 |
| Paths | 6 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | public function actionSave() |
||
| 36 | { |
||
| 37 | if (!file_exists($this->path)) { |
||
|
|
|||
| 38 | $this->mkdir($this->path); |
||
| 39 | } |
||
| 40 | foreach ($this->getItems() as $id => $config) { |
||
| 41 | $defaults = [ |
||
| 42 | 'class' => isset($config['template']) ? 'template' : 'directory', |
||
| 43 | 'file' => $this->path . '/' . $id, |
||
| 44 | ]; |
||
| 45 | $goal = $this->takeConfig()->createItem($id, array_merge($defaults, $config ?: [])); |
||
| 46 | $goal->perform(); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 56 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.