aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-03-04 14:44:04 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2021-03-04 14:44:04 +0100
commitc3f1eb4f7f2cdbee265b39ccc8096f27a4357c4e (patch)
treec7e62b7c533f6acd3c2a70cc095b283840cf290f
parent3bbacb2f541a513f47e0744ab8a629b936a091d8 (diff)
downloadnextcloud-server-c3f1eb4f7f2cdbee265b39ccc8096f27a4357c4e.tar.gz
nextcloud-server-c3f1eb4f7f2cdbee265b39ccc8096f27a4357c4e.zip
Remove Redundantcasts
For #25839 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--lib/private/DB/QueryBuilder/QueryBuilder.php4
-rw-r--r--lib/private/Files/Cache/Storage.php2
-rw-r--r--lib/public/DB/QueryBuilder/IQueryBuilder.php2
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php
index aa0327e89d9..35b7240abfe 100644
--- a/lib/private/DB/QueryBuilder/QueryBuilder.php
+++ b/lib/private/DB/QueryBuilder/QueryBuilder.php
@@ -1234,11 +1234,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'];
diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php
index 0a5d42e48c5..0c405e3af59 100644
--- a/lib/public/DB/QueryBuilder/IQueryBuilder.php
+++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php
@@ -967,7 +967,7 @@ interface IQueryBuilder {
* @throws \BadMethodCallException When being called before an insert query has been run.
* @since 9.0.0
*/
- public function getLastInsertId();
+ public function getLastInsertId(): int;
/**
* Returns the table name quoted and with database prefix as needed by the implementation