Switch logical operators

Unless there is a good reason to keep actual ones 👀
This commit is contained in:
acsfer 2021-12-03 16:05:19 +01:00 committed by GitHub
parent 82fc20f9d2
commit 074a9a5e88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,7 +151,7 @@ class Cache implements ICache {
$query = $this->getQueryBuilder();
$query->selectFileCache();
if (is_string($file) or $file == '') {
if (is_string($file) || $file == '') {
// normalize file
$file = $this->normalize($file);
@ -166,7 +166,7 @@ class Cache implements ICache {
$result->closeCursor();
//merge partial data
if (!$data and is_string($file) and isset($this->partial[$file])) {
if (!$data && is_string($file) && isset($this->partial[$file])) {
return $this->partial[$file];
} elseif (!$data) {
return $data;
@ -819,7 +819,7 @@ class Cache implements ICache {
$this->calculateFolderSize($path, $data);
if ($path !== '') {
$parent = dirname($path);
if ($parent === '.' or $parent === '/') {
if ($parent === '.' || $parent === '/') {
$parent = '';
}
if ($isBackgroundScan) {
@ -865,7 +865,7 @@ class Cache implements ICache {
*/
public function calculateFolderSize($path, $entry = null) {
$totalSize = 0;
if (is_null($entry) or !isset($entry['fileid'])) {
if (is_null($entry) || !isset($entry['fileid'])) {
$entry = $this->get($path);
}
if (isset($entry['mimetype']) && $entry['mimetype'] === FileInfo::MIMETYPE_FOLDER) {