From 951c5b973e2ed6b8e0511e9aca169af5ad557d02 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Tue, 2 May 2023 10:10:02 +0200 Subject: [PATCH] Normalize logical operators Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- lib/private/Files/View.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 91e6cc2d60e..66fe6efb6a5 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -227,7 +227,7 @@ class View { $parent = substr($path, 0, strrpos($path, '/') ?: 0); $path = $this->getAbsolutePath($path); [$storage, $internalPath] = Filesystem::resolvePath($path); - if (Filesystem::isValidPath($parent) and $storage) { + if (Filesystem::isValidPath($parent) && $storage) { return $storage->getLocalFile($internalPath); } else { return false; @@ -531,7 +531,7 @@ class View { * @param int|string $mtime */ public function touch($path, $mtime = null): bool { - if (!is_null($mtime) and !is_numeric($mtime)) { + if (!is_null($mtime) && !is_numeric($mtime)) { $mtime = strtotime($mtime); } @@ -614,7 +614,7 @@ class View { if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); if (Filesystem::isValidPath($path) - and !Filesystem::isFileBlacklisted($path) + && !Filesystem::isFileBlacklisted($path) ) { $path = $this->getRelativePath($absolutePath); if ($path === null) { @@ -724,14 +724,14 @@ class View { $result = false; if ( Filesystem::isValidPath($target) - and Filesystem::isValidPath($source) - and !Filesystem::isFileBlacklisted($target) + && Filesystem::isValidPath($source) + && !Filesystem::isFileBlacklisted($target) ) { $source = $this->getRelativePath($absolutePath1); $target = $this->getRelativePath($absolutePath2); $exists = $this->file_exists($target); - if ($source == null or $target == null) { + if ($source == null || $target == null) { return false; } @@ -816,7 +816,7 @@ class View { $this->emit_file_hooks_post($exists, $target); } } elseif ($result) { - if ($this->shouldEmitHooks($source) and $this->shouldEmitHooks($target)) { + if ($this->shouldEmitHooks($source) && $this->shouldEmitHooks($target)) { \OC_Hook::emit( Filesystem::CLASSNAME, Filesystem::signal_post_rename, @@ -853,13 +853,13 @@ class View { $result = false; if ( Filesystem::isValidPath($target) - and Filesystem::isValidPath($source) - and !Filesystem::isFileBlacklisted($target) + && Filesystem::isValidPath($source) + && !Filesystem::isFileBlacklisted($target) ) { $source = $this->getRelativePath($absolutePath1); $target = $this->getRelativePath($absolutePath2); - if ($source == null or $target == null) { + if ($source == null || $target == null) { return false; } $run = true; @@ -1111,7 +1111,7 @@ class View { $postFix = (substr($path, -1) === '/') ? '/' : ''; $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); if (Filesystem::isValidPath($path) - and !Filesystem::isFileBlacklisted($path) + && !Filesystem::isFileBlacklisted($path) ) { $path = $this->getRelativePath($absolutePath); if ($path == null) { @@ -1125,7 +1125,7 @@ class View { $run = $this->runHooks($hooks, $path); [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); - if ($run and $storage) { + if ($run && $storage) { /** @var Storage $storage */ if (in_array('write', $hooks) || in_array('delete', $hooks)) { try { @@ -1371,7 +1371,7 @@ class View { $info = new FileInfo($path, $storage, $internalPath, $data, $mount, $owner); if (isset($data['fileid'])) { - if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') { + if ($includeMountPoints && $data['mimetype'] === 'httpd/unix-directory') { //add the sizes of other mount points to the folder $extOnly = ($includeMountPoints === 'ext'); $this->addSubMounts($info, $extOnly); -- 2.39.5