From d5f928c2829cf84f93ed086b142f3eb6439e3064 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Tue, 11 Oct 2022 00:12:03 +0200 Subject: [PATCH] Upgrade Psalm, fix deprecations --- composer.json | 2 +- src/Types/GeometryType.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index d4eceb2..0b709ea 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "doctrine/data-fixtures": "^1.0", "phpunit/phpunit": "^9.0", "php-coveralls/php-coveralls": "^2.0", - "vimeo/psalm": "4.3.1" + "vimeo/psalm": "4.28.0" }, "autoload": { "psr-4": { diff --git a/src/Types/GeometryType.php b/src/Types/GeometryType.php index 56e70e9..478a8a9 100644 --- a/src/Types/GeometryType.php +++ b/src/Types/GeometryType.php @@ -8,9 +8,9 @@ use Brick\Geo\IO\WKBReader; use Brick\Geo\Proxy\GeometryProxy; use Brick\Geo\Proxy\ProxyInterface; -use Doctrine\DBAL\Platforms\MySqlPlatform; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform; -use Doctrine\DBAL\Platforms\PostgreSqlPlatform; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Types\Type; /** @@ -57,7 +57,7 @@ public function getName() : string public function getSQLDeclaration(array $column, AbstractPlatform $platform) : string { - if ($platform->getName() === 'postgresql') { + if ($platform instanceof PostgreSQLPlatform) { return 'GEOMETRY'; } @@ -106,7 +106,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) : ?st public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) : string { - if ($platform->getName() === 'mysql') { + if ($platform instanceof AbstractMySQLPlatform) { $sqlExpr = sprintf('BINARY %s', $sqlExpr); }