diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2021-03-05 08:42:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-05 08:42:54 +0100 |
commit | 85e48d796c6b4ec2c148b8d31630fa3a135c73e9 (patch) | |
tree | f57aaea19d61c77deaa4b186c0fb4d7528a3633a /lib/private | |
parent | cfb337dc0161f7879ee9ec2868e1fef24949f5fe (diff) | |
parent | c3f1eb4f7f2cdbee265b39ccc8096f27a4357c4e (diff) | |
download | nextcloud-server-85e48d796c6b4ec2c148b8d31630fa3a135c73e9.tar.gz nextcloud-server-85e48d796c6b4ec2c148b8d31630fa3a135c73e9.zip |
Merge pull request #25929 from nextcloud/techdept/psalm/25839/redundantcasts
Remove Redundantcasts
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/DB/QueryBuilder/QueryBuilder.php | 4 | ||||
-rw-r--r-- | lib/private/Files/Cache/Storage.php | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 83b233ac1b5..3549606c2db 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -1271,11 +1271,11 @@ class QueryBuilder implements IQueryBuilder { * @return int * @throws \BadMethodCallException When being called before an insert query has been run. */ - public function getLastInsertId() { + public function getLastInsertId(): int { if ($this->getType() === \Doctrine\DBAL\Query\QueryBuilder::INSERT && $this->lastInsertedTable) { // lastInsertId() needs the prefix but no quotes $table = $this->prefixTableName($this->lastInsertedTable); - return (int) $this->connection->lastInsertId($table); + return $this->connection->lastInsertId($table); } throw new \BadMethodCallException('Invalid call to getLastInsertId without using insert() before.'); diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php index 74f5df2a5b1..af37bef8415 100644 --- a/lib/private/Files/Cache/Storage.php +++ b/lib/private/Files/Cache/Storage.php @@ -77,7 +77,7 @@ class Storage { $connection = \OC::$server->getDatabaseConnection(); $available = $isAvailable ? 1 : 0; if ($connection->insertIfNotExist('*PREFIX*storages', ['id' => $this->storageId, 'available' => $available])) { - $this->numericId = (int)$connection->lastInsertId('*PREFIX*storages'); + $this->numericId = $connection->lastInsertId('*PREFIX*storages'); } else { if ($row = self::getStorageById($this->storageId)) { $this->numericId = (int)$row['numeric_id']; |