| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 1 | public function __destruct() |
|
| 18 | { |
||
| 19 | 1 | if($this->temp === '.' && file_exists("./smarty_compiled_templates")) |
|
| 20 | { |
||
| 21 | 1 | $files = scandir("./smarty_compiled_templates"); |
|
| 22 | 1 | foreach($files as $file) |
|
| 23 | { |
||
| 24 | 1 | if($file == "." | $file == "..") |
|
|
|
|||
| 25 | { |
||
| 26 | 1 | continue; |
|
| 27 | } |
||
| 28 | 1 | unlink("./smarty_compiled_templates/$file"); |
|
| 29 | } |
||
| 30 | 1 | rmdir("./smarty_compiled_templates"); |
|
| 31 | } |
||
| 32 | 1 | } |
|
| 33 | } |
||
| 34 |
When comparing the result of a bit operation, we suggest to add explicit parenthesis and not to rely on PHP’s built-in operator precedence to ensure the code behaves as intended and to make it more readable.
Let’s take a look at these examples: