diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2023-01-03 14:32:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-03 14:32:31 +0100 |
commit | 06da8adcd309952b7b83ebfaa88c7259a41cd2ed (patch) | |
tree | 47f1a69fe4f452098bfa62689bad43a7604a7a69 /lib | |
parent | 4e877b7ff1977389a67cafd6f028f40f83bc91b3 (diff) | |
parent | a7740c0ae67490aba55e9a05fcb09e7049818341 (diff) | |
download | nextcloud-server-06da8adcd309952b7b83ebfaa88c7259a41cd2ed.tar.gz nextcloud-server-06da8adcd309952b7b83ebfaa88c7259a41cd2ed.zip |
Merge pull request #35943 from nextcloud/fix/code-fixes-from-34997
Code fixes from PR 34997
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/EncodingDirectoryWrapper.php | 3 | ||||
-rw-r--r-- | lib/private/KnownUser/KnownUserMapper.php | 5 | ||||
-rwxr-xr-x | lib/private/LargeFileHelper.php | 2 | ||||
-rw-r--r-- | lib/private/Preview/Office.php | 2 | ||||
-rw-r--r-- | lib/private/legacy/OC_API.php | 7 |
5 files changed, 8 insertions, 11 deletions
diff --git a/lib/private/Files/Storage/Wrapper/EncodingDirectoryWrapper.php b/lib/private/Files/Storage/Wrapper/EncodingDirectoryWrapper.php index 935a15af4cf..fd0d2707f8d 100644 --- a/lib/private/Files/Storage/Wrapper/EncodingDirectoryWrapper.php +++ b/lib/private/Files/Storage/Wrapper/EncodingDirectoryWrapper.php @@ -31,7 +31,8 @@ use OC\Files\Filesystem; */ class EncodingDirectoryWrapper extends DirectoryWrapper { /** - * @return string + * @psalm-suppress ImplementedReturnTypeMismatch Until return type is fixed upstream + * @return string|false */ public function dir_readdir() { $file = readdir($this->source); diff --git a/lib/private/KnownUser/KnownUserMapper.php b/lib/private/KnownUser/KnownUserMapper.php index 864ece36345..ce7dc9ead63 100644 --- a/lib/private/KnownUser/KnownUserMapper.php +++ b/lib/private/KnownUser/KnownUserMapper.php @@ -32,7 +32,6 @@ use OCP\IDBConnection; * @method KnownUser mapRowToEntity(array $row) */ class KnownUserMapper extends QBMapper { - /** * @param IDBConnection $db */ @@ -49,7 +48,7 @@ class KnownUserMapper extends QBMapper { $query->delete($this->getTableName()) ->where($query->expr()->eq('known_to', $query->createNamedParameter($knownTo))); - return (int) $query->execute(); + return $query->executeStatement(); } /** @@ -61,7 +60,7 @@ class KnownUserMapper extends QBMapper { $query->delete($this->getTableName()) ->where($query->expr()->eq('known_user', $query->createNamedParameter($knownUser))); - return (int) $query->execute(); + return $query->executeStatement(); } /** diff --git a/lib/private/LargeFileHelper.php b/lib/private/LargeFileHelper.php index 82b3c5ae760..a9c5a329620 100755 --- a/lib/private/LargeFileHelper.php +++ b/lib/private/LargeFileHelper.php @@ -50,7 +50,7 @@ class LargeFileHelper { /** * @brief Checks whether our assumptions hold on the PHP platform we are on. * - * @throws \RunTimeException if our assumptions do not hold on the current + * @throws \RuntimeException if our assumptions do not hold on the current * PHP platform. */ public function __construct() { diff --git a/lib/private/Preview/Office.php b/lib/private/Preview/Office.php index 6717584e887..3ba7c5a21a0 100644 --- a/lib/private/Preview/Office.php +++ b/lib/private/Preview/Office.php @@ -71,7 +71,7 @@ abstract class Office extends ProviderV2 { [$dirname, , , $filename] = array_values(pathinfo($absPath)); $pngPreview = $tmpDir . '/' . $filename . '.png'; - $png = new \imagick($pngPreview . '[0]'); + $png = new \Imagick($pngPreview . '[0]'); $png->setImageFormat('jpg'); } catch (\Exception $e) { $this->cleanTmpFiles(); diff --git a/lib/private/legacy/OC_API.php b/lib/private/legacy/OC_API.php index 9e9c28e2dba..46ee3495572 100644 --- a/lib/private/legacy/OC_API.php +++ b/lib/private/legacy/OC_API.php @@ -98,13 +98,10 @@ class OC_API { } } - /** - * @return string - */ - public static function requestedFormat() { + public static function requestedFormat(): string { $formats = ['json', 'xml']; - $format = !empty($_GET['format']) && in_array($_GET['format'], $formats) ? $_GET['format'] : 'xml'; + $format = (isset($_GET['format']) && in_array($_GET['format'], $formats)) ? $_GET['format'] : 'xml'; return $format; } |