Skip to content

Commit

Permalink
Issue #57 fixed (#59)
Browse files Browse the repository at this point in the history
* Fix comments in #43
* Fix #57
* "declare(strict_types=1)" added.
* Fix CI
* Fixing comment headers
  • Loading branch information
Alexandre-T committed May 1, 2024
1 parent 23c7e7f commit 804498e
Show file tree
Hide file tree
Showing 284 changed files with 674 additions and 176 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ jobs:
- name: Force doctrine/orm library to ${{ matrix.orm }}
run: composer --prefer-stable require doctrine/orm:${{ matrix.orm }} --with-all-dependencies
- name: Run test suite and coverage
if: ${{ matrix.php == '8.3' && env.HAS_CC_SECRET == 'true' }}
if: ${{ matrix.php == '8.3' && matrix.orm == '^3.1' && env.HAS_CC_SECRET == 'true' }}
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageCommand: composer run-script test-coverage
coverageLocations: ${{github.workspace}}/.phpunit.cache/code-coverage/clover*.xml:clover
- name: Run test suite for forks or version without coverage
if: ${{ matrix.php != '8.3' || env.HAS_CC_SECRET != 'true' }}
if: ${{ matrix.php != '8.3' || matrix.orm != '^3.1' || env.HAS_CC_SECRET != 'true' }}
run: composer run-script test
- name: Coveralls.io steps
if: ${{ matrix.php == '8.3' && env.HAS_CA_SECRET == 'true' }}
if: ${{ matrix.php == '8.3' && matrix.orm == '^3.1' && env.HAS_CA_SECRET == 'true' }}
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'@PHP73Migration' => true,
// 'strict_param' => true,
'@PHP74Migration' => true,
'@PHP80Migration' => true,
'declare_strict_types' => true,
'array_syntax' => ['syntax' => 'short'],
'dir_constant' => true,
'ereg_to_preg' => true,
Expand Down
6 changes: 4 additions & 2 deletions lib/LongitudeOne/Spatial/DBAL/Platform/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Platform;

use LongitudeOne\Geo\WKB\Parser as BinaryParser;
Expand Down Expand Up @@ -43,7 +45,7 @@ abstract class AbstractPlatform implements PlatformInterface
*/
protected static function checkSrid(array $column, ?int $srid): ?int
{
$srid = $srid ?? $column['srid'] ?? null;
$srid ??= $column['srid'] ?? null;

if (null !== $srid && !is_int($srid)) {
$message = sprintf(
Expand All @@ -67,7 +69,7 @@ protected static function checkSrid(array $column, ?int $srid): ?int
*/
protected static function checkType(array $column, ?AbstractSpatialType $type): AbstractSpatialType
{
$type = $type ?? $column['type'] ?? null;
$type ??= $column['type'] ?? null;

if (!$type instanceof AbstractSpatialType) {
throw new MissingArgumentException('Arguments aren\'t well defined. Please provide a type.');
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Platform/MySql.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Platform;

use LongitudeOne\Spatial\DBAL\Types\AbstractSpatialType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Platform/PlatformInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Platform;

use LongitudeOne\Spatial\DBAL\Types\AbstractSpatialType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Platform/PostgreSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Platform;

use LongitudeOne\Spatial\DBAL\Types\AbstractSpatialType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Types/AbstractSpatialType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types;

interface DoctrineSpatialTypeInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geography;

use LongitudeOne\Spatial\DBAL\Types\GeographyType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Types/Geography/PointType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geography;

use LongitudeOne\Spatial\DBAL\Types\GeographyType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Types/Geography/PolygonType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geography;

use LongitudeOne\Spatial\DBAL\Types\GeographyType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Types/GeographyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geometry;

use LongitudeOne\Spatial\DBAL\Types\GeometryType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geometry;

use LongitudeOne\Spatial\DBAL\Types\GeometryType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geometry;

use LongitudeOne\Spatial\DBAL\Types\GeometryType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geometry;

use LongitudeOne\Spatial\DBAL\Types\GeometryType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Types/Geometry/PointType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geometry;

use LongitudeOne\Spatial\DBAL\Types\GeometryType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Types/Geometry/PolygonType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types\Geometry;

use LongitudeOne\Spatial\DBAL\Types\GeometryType;
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/DBAL/Types/GeometryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\DBAL\Types;

/**
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\Exception;

/**
Expand Down
2 changes: 2 additions & 0 deletions lib/LongitudeOne/Spatial/Exception/InvalidValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\Exception;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\Exception;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\Exception;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions;

use Doctrine\DBAL\Exception;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\MySql;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\PostgreSql;

use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\PostgreSql;

use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

declare(strict_types=1);

namespace LongitudeOne\Spatial\ORM\Query\AST\Functions\PostgreSql;

use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
Expand Down
Loading

0 comments on commit 804498e

Please sign in to comment.