Skip to content

Commit 019c48f

Browse files
committed
Remove redundant isDot() check and fix static analysis warnings
1 parent 8435e15 commit 019c48f

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/Cacheresource/File.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,8 @@ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $e
221221
$_filepath = (string)$_file;
222222
// directory ?
223223
if ($_file->isDir()) {
224-
if (!$_file->isDot()) {
225-
// delete folder if empty
226-
@rmdir($_file->getPathname());
227-
}
224+
// delete folder if empty
225+
@rmdir($_file->getPathname());
228226
} else {
229227
// delete only php files
230228
if (substr($_filepath, -4) !== '.php') {

src/Smarty.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,10 +1344,8 @@ public function clearCompiledTemplate($resource_name = null, $compile_id = null,
13441344
}
13451345
$_filepath = (string)$_file;
13461346
if ($_file->isDir()) {
1347-
if (!$_file->isDot()) {
1348-
// delete folder if empty
1349-
@rmdir($_file->getPathname());
1350-
}
1347+
// delete folder if empty
1348+
@rmdir($_file->getPathname());
13511349
} else {
13521350
// delete only php files
13531351
if (substr($_filepath, -4) !== '.php') {

tests/PHPUnit_Smarty.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,8 @@ public function cleanDir($dir)
291291
}
292292
// directory ?
293293
if ($file->isDir()) {
294-
if (!$file->isDot()) {
295-
// delete folder if empty
296-
@rmdir($file->getPathname());
297-
}
294+
// delete folder if empty
295+
@rmdir($file->getPathname());
298296
} else {
299297
unlink($file->getPathname());
300298
}

0 commit comments

Comments
 (0)