diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 2816c96e666d..087a65ac1bb6 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -1477,14 +1477,14 @@ public function createSchedulingObject($principalUri, $objectUri, $objectData) { */ protected function addChange($calendarId, $objectUri, $operation) { $stmt = $this->db->prepare('INSERT INTO `*PREFIX*calendarchanges` (`uri`, `synctoken`, `calendarid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*calendars` WHERE `id` = ?'); - $stmt->execute([ + $stmt->executeStatement([ $objectUri, $calendarId, $operation, $calendarId ]); $stmt = $this->db->prepare('UPDATE `*PREFIX*calendars` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?'); - $stmt->execute([ + $stmt->executeStatement([ $calendarId ]); } diff --git a/lib/private/AppFramework/Db/Db.php b/lib/private/AppFramework/Db/Db.php index c5c92f8f34cd..e7e4c9660d88 100644 --- a/lib/private/AppFramework/Db/Db.php +++ b/lib/private/AppFramework/Db/Db.php @@ -52,7 +52,7 @@ public function __construct(IDBConnection $connection) { /** * @inheritdoc */ - public function getQueryBuilder() { + public function getQueryBuilder(): IQueryBuilder { return $this->connection->getQueryBuilder(); } diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index bbb97a7a30b4..0bd406180be5 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -36,6 +36,7 @@ use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Statement; use OC\DB\QueryBuilder\QueryBuilder; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; @@ -63,12 +64,7 @@ public function connect() { } } - /** - * Returns a QueryBuilder for the connection. - * - * @return \OCP\DB\QueryBuilder\IQueryBuilder - */ - public function getQueryBuilder() { + public function getQueryBuilder(): IQueryBuilder { return new QueryBuilder($this); } @@ -148,14 +144,6 @@ public function __construct( parent::setTransactionIsolation(parent::TRANSACTION_READ_COMMITTED); } - /** - * Prepares an SQL statement. - * - * @param string $statement The SQL statement to prepare. - * @param int $limit - * @param int $offset - * @return \Doctrine\DBAL\Driver\Statement The prepared statement. - */ public function prepare($statement, $limit=null, $offset=null) { if ($limit === -1) { $limit = null; @@ -181,7 +169,7 @@ public function prepare($statement, $limit=null, $offset=null) { * @param array $types The types the previous parameters are in. * @param \Doctrine\DBAL\Cache\QueryCacheProfile|null $qcp The query cache profile, optional. * - * @return \Doctrine\DBAL\Driver\Statement The executed statement. + * @return Statement The executed statement. * * @throws \Doctrine\DBAL\DBALException */ diff --git a/lib/public/IDBConnection.php b/lib/public/IDBConnection.php index 0b444cb6df8a..45ff04866cc9 100644 --- a/lib/public/IDBConnection.php +++ b/lib/public/IDBConnection.php @@ -35,6 +35,7 @@ // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; use Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Statement; use OCP\DB\QueryBuilder\IQueryBuilder; /** @@ -47,17 +48,17 @@ interface IDBConnection { /** * Gets the QueryBuilder for the connection. * - * @return \OCP\DB\QueryBuilder\IQueryBuilder + * @return IQueryBuilder * @since 8.2.0 */ - public function getQueryBuilder(); + public function getQueryBuilder(): IQueryBuilder; /** * Used to abstract the ownCloud database access away * @param string $sql the sql query with ? placeholder for params * @param int $limit the maximum number of rows * @param int $offset from which row we want to start - * @return \Doctrine\DBAL\Driver\Statement The prepared statement. + * @return Statement The prepared statement. * @since 6.0.0 */ public function prepare($sql, $limit=null, $offset=null); @@ -71,7 +72,7 @@ public function prepare($sql, $limit=null, $offset=null); * @param string $query The SQL query to execute. * @param string[] $params The parameters to bind to the query, if any. * @param array $types The types the previous parameters are in. - * @return \Doctrine\DBAL\Driver\Statement The executed statement. + * @return Statement The executed statement. * @since 8.0.0 */ public function executeQuery($query, array $params = [], $types = []);