Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Doctrine/MySql/UseIndexHintHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use function preg_match_all;
use function preg_quote;
use function preg_replace;
use function sprintf;

class UseIndexHintHandler extends HintHandler
{
Expand All @@ -35,8 +36,8 @@ public function processNode(SqlNode $sqlNode, string $sql): string
$query = $sqlWalker->getQuery();
$platform = $query->getEntityManager()->getConnection()->getDatabasePlatform();

if (!is_a($platform, 'Doctrine\DBAL\Platforms\MySqlPlatform')) { // bypass platform MySqlPlatform => MySQLPlatform rename in dbal
throw new LogicException("Only MySQL platform is supported, {$platform->getName()} given");
if (!is_a($platform, 'Doctrine\DBAL\Platforms\AbstractMySQLPlatform')) {
throw new LogicException(sprintf('Only MySQL platform is supported, %s given', $platform::class));
}

if (!$query->getAST() instanceof SelectStatement) {
Expand Down
Loading