hiqdev /
hidev
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | /* |
||
| 4 | * Task runner, code generator and build tool for easier continuos integration |
||
| 5 | * |
||
| 6 | * @link https://github.com/hiqdev/hidev |
||
| 7 | * @package hidev |
||
| 8 | * @license BSD-3-Clause |
||
| 9 | * @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/) |
||
| 10 | */ |
||
| 11 | |||
| 12 | namespace hidev\controllers; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Generate goal to build files by template and params. |
||
| 16 | */ |
||
| 17 | class GenerateController extends TemplateController |
||
| 18 | { |
||
| 19 | public static function template2file($template, $extension = '.php') |
||
| 20 | { |
||
| 21 | $a = pathinfo($template); |
||
| 22 | |||
| 23 | return $a['dirname'] . '/' . $a['filename'] . $extension; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function actionPerform($template = null, $file = null) |
||
| 27 | { |
||
| 28 | $this->template = $template; |
||
| 29 | $this->file = $file ?: static::template2file($template); |
||
|
0 ignored issues
–
show
|
|||
| 30 | |||
| 31 | return parent::actionPerform(); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function actionOnce($template, $file = null) |
||
| 35 | { |
||
| 36 | $file = $file ?: static::template2file($template); |
||
| 37 | if (file_exists($file)) { |
||
| 38 | return; |
||
| 39 | } |
||
| 40 | |||
| 41 | return $this->actionPerform($template, $file); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function actionMkdir($dir) |
||
| 45 | { |
||
| 46 | if (file_exists($dir)) { |
||
| 47 | return; |
||
| 48 | } |
||
| 49 | mkdir($dir, 0777, true); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.