Skip to content

Commit

Permalink
Fix coding standards/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carnage committed Oct 2, 2020
1 parent 8d186e7 commit 15f3890
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/Doctrine/DBAL/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,8 @@ public function getMaxResults()

/**
* Gets the current lock mode for this query
*
* @return int|null
*/
public function getLockMode()
public function getLockMode(): ?int
{
return $this->lockMode;
}
Expand All @@ -423,10 +421,8 @@ public function getLockMode()
* Set lock mode use one of the constants from LockMode::class locks are only added to SELECT queries
*
* Optimistic locking *is not* supported by DBAL.
*
* @param int $lockMode
*/
public function setLockMode(int $lockMode)
public function setLockMode(int $lockMode): self
{
$this->lockMode = $lockMode;

Expand Down Expand Up @@ -1198,7 +1194,6 @@ private function getSQLForSelect()
. ($this->sqlParts['having'] !== null ? ' HAVING ' . ((string) $this->sqlParts['having']) : '')
. ($this->sqlParts['orderBy'] ? ' ORDER BY ' . implode(', ', $this->sqlParts['orderBy']) : '');


if ($this->isLimitQuery()) {
return $databasePlatform->modifyLimitQuery(
$query,
Expand Down
7 changes: 7 additions & 0 deletions tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Query\Expression\ExpressionBuilder;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Query\QueryException;
Expand All @@ -23,6 +24,12 @@ protected function setUp(): void
$this->conn->expects($this->any())
->method('getExpressionBuilder')
->will($this->returnValue($expressionBuilder));

$platform = new SqlitePlatform();

$this->conn->expects($this->any())
->method('getPlatform')
->will($this->returnValue($platform));
}

public function testSimpleSelectWithoutFrom(): void
Expand Down

0 comments on commit 15f3890

Please sign in to comment.