Skip to content

Commit 03a133d

Browse files
authored
get rid of deprecated method Platform::getName; include MariaDB as a part of MySQLPlatform (#120)
* get rid of deprecated method `Platform::getName`; include MariaDB as a part of MySQLPlatform * string to ::class * reverting the dev dependency side effect
1 parent ae6e84e commit 03a133d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Doctrine/MySql/UseIndexHintHandler.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use function preg_match_all;
1717
use function preg_quote;
1818
use function preg_replace;
19+
use function sprintf;
1920

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

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

4243
if (!$query->getAST() instanceof SelectStatement) {

0 commit comments

Comments
 (0)