fix: SA: Fix "...does not match parent method..." rule.

SA stands for Static Analysis.
This commit is contained in:
Pol Dellaiera
2021-11-16 15:17:29 +01:00
parent e2a8437807
commit 479f0ce9ed
2 changed files with 10 additions and 21 deletions

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Chill\MainBundle\Doctrine\Type;
use Chill\MainBundle\Doctrine\Model\Point;
@@ -7,40 +9,32 @@ use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Chill\MainBundle\Doctrine\Model\PointException;
/**
* A Type for Doctrine to implement the Geography Point type
* implemented by Postgis on postgis+postgresql databases
*
*/
class PointType extends Type {
const POINT = 'point';
class PointType extends Type
{
public const POINT = 'point';
/**
*
* @param array $fieldDeclaration
* @param AbstractPlatform $platform
* @return string
*/
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
public function getSQLDeclaration(array $column, AbstractPlatform $platform)
{
return 'geometry(POINT,'.Point::$SRID.')';
}
/**
*
* @param type $value
* @param AbstractPlatform $platform
* @return ?Point
*/
public function convertToPHPValue($value, AbstractPlatform $platform)
{
if ($value === NULL){
return NULL;
} else {
return Point::fromGeoJson($value);
}
return Point::fromGeoJson($value);
}
public function getName()
@@ -52,9 +46,9 @@ class PointType extends Type {
{
if ($value === NULL){
return NULL;
} else {
return $value->toWKT();
}
return $value->toWKT();
}
public function canRequireSQLConversion()