From 9fcaa6147f2635f06c428c47752b9f40c717cae1 Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Fri, 3 Jan 2025 22:58:47 +0300 Subject: [PATCH] refactor: Fix phpstan always true --- system/Helpers/filesystem_helper.php | 2 +- utils/phpstan-baseline/booleanAnd.rightAlwaysTrue.neon | 8 -------- utils/phpstan-baseline/loader.neon | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 utils/phpstan-baseline/booleanAnd.rightAlwaysTrue.neon diff --git a/system/Helpers/filesystem_helper.php b/system/Helpers/filesystem_helper.php index d5f2d974e4ad..6acf6f38f846 100644 --- a/system/Helpers/filesystem_helper.php +++ b/system/Helpers/filesystem_helper.php @@ -96,7 +96,7 @@ function directory_mirror(string $originDir, string $targetDir, bool $overwrite if (! is_dir($target)) { mkdir($target, 0755); } - } elseif (! is_file($target) || ($overwrite && is_file($target))) { + } elseif ($overwrite || ! is_file($target)) { copy($origin, $target); } } diff --git a/utils/phpstan-baseline/booleanAnd.rightAlwaysTrue.neon b/utils/phpstan-baseline/booleanAnd.rightAlwaysTrue.neon deleted file mode 100644 index 0a05a1a708cc..000000000000 --- a/utils/phpstan-baseline/booleanAnd.rightAlwaysTrue.neon +++ /dev/null @@ -1,8 +0,0 @@ -# total 1 error - -parameters: - ignoreErrors: - - - message: '#^Right side of && is always true\.$#' - count: 1 - path: ../../system/Helpers/filesystem_helper.php diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index feab1b53df83..308117dcd44c 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,7 +1,6 @@ includes: - argument.type.neon - assign.propertyType.neon - - booleanAnd.rightAlwaysTrue.neon - codeigniter.cacheHandlerInstance.neon - codeigniter.configArgumentInstanceof.neon - codeigniter.frameworkExceptionInstance.neon