mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix: SA: Fix "...does not match parent method..." rule.
SA stands for Static Analysis.
This commit is contained in:
parent
e2a8437807
commit
479f0ce9ed
@ -55,11 +55,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||
|
||||
-
|
||||
message: "#^Method Chill\\\\MainBundle\\\\Doctrine\\\\Type\\\\PointType\\:\\:getSqlDeclaration\\(\\) does not match parent method name\\: Doctrine\\\\DBAL\\\\Types\\\\Type\\:\\:getSQLDeclaration\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php
|
||||
|
||||
-
|
||||
message: "#^Foreach overwrites \\$line with its value variable\\.$#"
|
||||
count: 2
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user