Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix phpstan booleanAnd.rightAlwaysTrue #9367

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/Helpers/filesystem_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} elseif ($overwrite || ! is_file($target)) {
} elseif (! is_file($target) || $overwrite)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the first check is true, then the next ones will not run. calling is_file() is not important, micro optimization

copy($origin, $target);
}
}
Expand Down
8 changes: 0 additions & 8 deletions utils/phpstan-baseline/booleanAnd.rightAlwaysTrue.neon

This file was deleted.

1 change: 0 additions & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
includes:
- argument.type.neon
- assign.propertyType.neon
- booleanAnd.rightAlwaysTrue.neon
- class.notFound.neon
- codeigniter.cacheHandlerInstance.neon
- codeigniter.configArgumentInstanceof.neon
Expand Down
Loading