-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,23 +16,23 @@ class PolygonType extends Type | |
/** | ||
Check failure on line 16 in src/Types/PolygonType.php
|
||
* {@inheritDoc} | ||
*/ | ||
public function getName() | ||
public function getName(): string | ||
{ | ||
return self::FIELD; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) | ||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string | ||
{ | ||
return 'POLYGON'; | ||
} | ||
|
||
/** | ||
Check failure on line 32 in src/Types/PolygonType.php
|
||
* {@inheritDoc} | ||
*/ | ||
public function canRequireSQLConversion() | ||
public function canRequireSQLConversion(): bool | ||
{ | ||
return true; | ||
} | ||
|
@@ -42,7 +42,7 @@ public function canRequireSQLConversion() | |
* | ||
* @return string | ||
*/ | ||
public function convertToPHPValue($value, AbstractPlatform $platform) | ||
public function convertToPHPValue($value, AbstractPlatform $platform): string | ||
{ | ||
preg_match('/POLYGON\(\((.*)\)\)/', $value, $matches); | ||
if (! isset($matches[1])) { | ||
|
@@ -55,23 +55,23 @@ public function convertToPHPValue($value, AbstractPlatform $platform) | |
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function convertToPHPValueSQL($sqlExpr, $platform) | ||
public function convertToPHPValueSQL($sqlExpr, $platform): string | ||
{ | ||
return sprintf('AsText(%s)', $sqlExpr); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function convertToDatabaseValue($value, AbstractPlatform $platform) | ||
public function convertToDatabaseValue($value, AbstractPlatform $platform): string | ||
{ | ||
return sprintf('POLYGON((%s))', $value); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) | ||
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform): string | ||
{ | ||
return sprintf('ST_PolygonFromText(%s)', $sqlExpr); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters