Skip to content

Commit

Permalink
Dev: Code style
Browse files Browse the repository at this point in the history
Still one error from PHPStan that frankly I don't understand - it says
$type is always a string, but it isn't. Can't find out in their docs how
to specify the type of a local variable.
  • Loading branch information
AllanJard committed Feb 27, 2024
1 parent e908d5e commit 3c293e4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Editor/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,14 +697,11 @@ private function _dbExec($upload, $db)
foreach ($pathFields as $column => $type) {
if ($type === self::DB_WEB_PATH) {
$q->set($column, $webPath);
}
else if ($type === self::DB_SYSTEM_PATH) {
} else if ($type === self::DB_SYSTEM_PATH) {
$q->set($column, $path);
}
else if (is_string($type)) {
} else if (is_string($type)) {

Check failure on line 702 in Editor/Upload.php

View workflow job for this annotation

GitHub Actions / Unit (latest, StaticAnalysis)

Call to function is_string() with non-falsy-string will always evaluate to true.
$q->set($column, str_replace('__ID__', $id, $type));
}
else {
} else {
$q->set($column, $type);
}
}
Expand Down

0 comments on commit 3c293e4

Please sign in to comment.