Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
38 | protected function compileInitialization(Buffer $buffer) |
||
39 | { |
||
40 | $buffer->write('$app = new Zicht\Tool\Application(') |
||
41 | ->asPhp($this->appName) |
||
42 | ->raw(', Zicht\Version\Version::fromString(') |
||
43 | ->asPhp($this->appVersion) |
||
44 | ->raw(') ?: new Zicht\Version\Version(), Zicht\Tool\Configuration\ConfigurationLoader::fromEnv(')->asPhp($this->configFilename)->raw(')') |
||
45 | ->raw(');') |
||
46 | ->eol(); |
||
47 | } |
||
48 | } |
||
49 |
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: