| Conditions | 5 |
| Paths | 4 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function __destruct() |
||
| 21 | { |
||
| 22 | if($this->temp === '.' && file_exists("./smarty_compiled_templates")) { |
||
| 23 | $files = scandir("./smarty_compiled_templates"); |
||
| 24 | foreach($files as $file) { |
||
| 25 | if($file == "." | $file == "..") { |
||
|
|
|||
| 26 | continue; |
||
| 27 | } |
||
| 28 | unlink("./smarty_compiled_templates/$file"); |
||
| 29 | } |
||
| 30 | rmdir("./smarty_compiled_templates"); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 41 |
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: