Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
41 | 30 | private function incrementPath($originalFilePath, $increment) |
|
42 | { |
||
43 | 30 | if ($this->pathHasExtension($originalFilePath)) { |
|
44 | 12 | return preg_replace('#^(.+)\.([\w]+)$#i', '$1_' . $increment . '.$2', $originalFilePath); |
|
45 | } |
||
46 | |||
47 | 18 | return $originalFilePath . '_' . $increment; |
|
48 | } |
||
49 | |||
59 |
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: