Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get rid of deprecated method Platform::getName; include MariaDB as a part of MySQLPlatform #120

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
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')) {
someson marked this conversation as resolved.
Show resolved Hide resolved
throw new LogicException(sprintf('Only MySQL platform is supported, %s given', $platform::class));
}

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