Skip to content

Commit

Permalink
Fix CS violations
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Jan 28, 2024
1 parent 04b89f5 commit 9f085f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions lib/Doctrine/ORM/Query/Exec/FinalizedSelectExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Result;
use Doctrine\DBAL\Types\Type;

/**
* SQL executor for a given, final, single SELECT SQL query
Expand All @@ -19,6 +20,10 @@ public function __construct(string $sql)
$this->sqlStatements = $sql;
}

/**
* @param list<mixed>|array<string, mixed> $params
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types
*/
public function execute(Connection $conn, array $params, array $types): Result
{
return $conn->executeQuery($this->getSqlStatements(), $params, $types, $this->queryCacheProfile);
Expand Down
8 changes: 4 additions & 4 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH11112Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ public function testSimpleQueryHasLimitAndOffsetApplied(): void

$query->setMaxResults(10);
$query->setFirstResult(20);
$sql10_20 = $query->getSQL();
$sqlMax10First20 = $query->getSQL();

$query->setMaxResults(30);
$query->setFirstResult(40);
$sql30_40 = $query->getSQL();
$sqlMax30First40 = $query->getSQL();

// The SQL is platform specific and may even be something with outer SELECTS being added. So,
// derive the expected value at runtime through the platform.
self::assertSame($platform->modifyLimitQuery($originalSql, 10, 20), $sql10_20);
self::assertSame($platform->modifyLimitQuery($originalSql, 30, 40), $sql30_40);
self::assertSame($platform->modifyLimitQuery($originalSql, 10, 20), $sqlMax10First20);
self::assertSame($platform->modifyLimitQuery($originalSql, 30, 40), $sqlMax30First40);

$cacheEntries = self::$queryCache->getValues();
self::assertCount(1, $cacheEntries);
Expand Down

0 comments on commit 9f085f8

Please sign in to comment.