Skip to content

Commit 0c54aa0

Browse files
committed
Merge branch 'main' into dev
# Conflicts: # lib/LongitudeOne/Spatial/PHP/Types/AbstractGeometry.php
2 parents 8adf06c + ccb069b commit 0c54aa0

File tree

280 files changed

+739
-724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+739
-724
lines changed

.github/workflows/full.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ jobs:
99
environment: 'Test environment'
1010
strategy:
1111
matrix:
12-
php: [ '7.4', '8.0' ]
12+
php: [ '8.1' ]
1313
name: PHP${{ matrix.php }}/MySQL5.7/MySQL8.0/PgSQL
14+
env:
15+
HAS_CC_SECRET: ${{secrets.CC_TEST_REPORTER_ID != '' }}
1416
services:
1517
mysql5:
1618
image: mysql:5.7
@@ -72,12 +74,16 @@ jobs:
7274
run: cp .github/phpunit.*.xml .
7375
- name: Install libraries
7476
run: composer update -vvv
75-
- name: Run test suite and covergage
76-
uses: paambaati/[email protected]
77+
- name: Run test suite and coverage
78+
if: env.HAS_CC_SECRET == 'true'
79+
uses: paambaati/[email protected]
7780
env:
7881
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
7982
with:
8083
coverageCommand: composer run-script test
8184
coverageLocations: ${{github.workspace}}/.phpunit.cache/clover*.xml:clover
85+
- name: Run test suite for forks
86+
if: env.HAS_CC_SECRET != 'true'
87+
run: composer run-script test
8288
- name: Check quality code
8389
run: composer run-script check-quality-code

.php-cs-fixer.dist.php

+32-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
11
<?php
2+
/**
3+
* This file is part of the doctrine spatial extension.
4+
*
5+
* PHP 8.1
6+
*
7+
* (c) Alexandre Tranchant <[email protected]> 2017 - 2022
8+
* (c) Longitude One 2020 - 2022
9+
* (c) 2015 Derek J. Lambert
10+
*
11+
* For the full copyright and license information, please view the LICENSE
12+
* file that was distributed with this source code.
13+
*
14+
*/
215

316
$finder = PhpCsFixer\Finder::create()
417
->in(__DIR__)
518
->exclude('var')
619
->exclude('vendor')
720
;
821

9-
$header = <<<EOF
10-
This file is part of the doctrine spatial extension.
22+
$header = <<<'EOF'
23+
This file is part of the doctrine spatial extension.
1124
12-
PHP 7.4 | 8.0 | 8.1
25+
PHP 8.1
1326
14-
(c) Alexandre Tranchant <[email protected]> 2017 - 2022
15-
(c) Longitude One 2020 - 2022
16-
(c) 2015 Derek J. Lambert
27+
(c) Alexandre Tranchant <[email protected]> 2017 - 2022
28+
(c) Longitude One 2020 - 2022
29+
(c) 2015 Derek J. Lambert
1730
18-
For the full copyright and license information, please view the LICENSE
19-
file that was distributed with this source code.
31+
For the full copyright and license information, please view the LICENSE
32+
file that was distributed with this source code.
2033

21-
EOF;
34+
EOF;
2235

2336
return (new PhpCsFixer\Config())
2437
// ->setCacheFile(__DIR__.'/.php_cs.cache')
@@ -30,23 +43,23 @@
3043
'@PHP70Migration' => true,
3144
'@PHP71Migration' => true,
3245
'@PHP73Migration' => true,
33-
// 'strict_param' => true,
46+
// 'strict_param' => true,
3447
'array_syntax' => ['syntax' => 'short'],
3548
'dir_constant' => true,
3649
'ereg_to_preg' => true,
3750
'header_comment' => [
3851
'comment_type' => 'PHPDoc',
3952
'header' => $header,
4053
'location' => 'after_open',
41-
'separate' => 'bottom'
54+
'separate' => 'bottom',
4255
],
43-
// 'date_time_immutable' => true,
44-
// 'declare_strict_types' => true,
56+
// 'date_time_immutable' => true,
57+
// 'declare_strict_types' => true,
4558
'is_null' => true,
4659
'mb_str_functions' => true,
4760
'modernize_types_casting' => true,
4861
'no_unneeded_final_method' => true,
49-
// 'no_alias_functions' =>true,
62+
// 'no_alias_functions' =>true,
5063
'ordered_interfaces' => [
5164
'direction' => 'ascend',
5265
'order' => 'alpha',
@@ -60,12 +73,13 @@
6073
'construct', 'destruct',
6174
'phpunit',
6275
'method_public_static', 'method_protected_static', 'method_private_static', 'method_static',
63-
'method_public', 'method_protected', 'method_private', 'method', 'magic'
76+
'method_public', 'method_protected', 'method_private', 'method', 'magic',
6477
],
65-
'sort_algorithm' => 'alpha'
78+
'sort_algorithm' => 'alpha',
6679
],
6780
'php_unit_test_case_static_method_calls' => true,
68-
'single_line_throw' => false
81+
'single_line_throw' => false,
6982
])
83+
->setRiskyAllowed(true)
7084
->setFinder($finder)
71-
;
85+
;

.travis.yml

+6-78
Original file line numberDiff line numberDiff line change
@@ -34,102 +34,30 @@ notifications:
3434

3535
jobs:
3636
include:
37-
#MySQL 5.7 PHP 7.4
38-
- stage: PHP7.4
39-
name: 'MySQL5.7'
40-
php: 7.4
41-
env: DB=mysql MYSQL_VERSION=5.7 COVERAGE=yes
42-
services:
43-
- mysql
44-
#MySQL 8 PHP 7.4
45-
- stage: PHP7.4
46-
name: MySQL8
47-
php: 7.4
48-
env: DB=mysql.docker MYSQL_VERSION=8.0 COVERAGE=yes
49-
sudo: required
50-
services:
51-
- docker
52-
before_script:
53-
- bash ./tests/travis/install-mysql-8.0.sh
54-
#MySQLi5.7 PHP 7.4
55-
- stage: PHP7.4
56-
name: MySQLi5.7
57-
php: 7.4
58-
env: DB=mysqli MYSQL_VERSION=5.7 COVERAGE=yes
59-
services:
60-
- mysql
61-
#MySQLi8 PHP 7.4
62-
- stage: PHP7.4
63-
name: MySQLi8.0
64-
php: 7.4
65-
env: DB=mysqli.docker MYSQL_VERSION=8.0 COVERAGE=yes
66-
sudo: required
67-
services:
68-
- docker
69-
before_script:
70-
- bash ./tests/travis/install-mysql-8.0.sh
71-
#PostgreSQL9.6 PHP7.4 Postgis 2.5
72-
- stage: PHP7.4
73-
name: PgSQL9.6 Postgis 2.5
74-
php: 7.4
75-
env: DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes
76-
addons:
77-
postgresql: "9.6"
78-
apt:
79-
packages:
80-
- postgis
81-
- postgresql-9.6-postgis-2.5
82-
#PostgreSQL10 PHP7.4 Postgis 2.5
83-
- stage: PHP7.4
84-
name: PgSQL10 Postgis 2.5
85-
php: 7.4
86-
env: DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes
87-
sudo: required
88-
addons:
89-
postgresql: "10"
90-
apt:
91-
packages:
92-
- postgresql-10
93-
- postgresql-client-10
94-
- postgis
95-
- postgresql-10-postgis-2.5
96-
#PostgreSQL11 PHP7.4 Postgis 2.5
97-
- stage: PHP7.4
98-
name: PostgreSQL11 Postgis2.5
99-
php: 7.4
100-
env: DB=pgsql POSTGRESQL_VERSION=11.0 COVERAGE=yes
101-
sudo: required
102-
addons:
103-
postgresql: "11"
104-
apt:
105-
packages:
106-
- postgis
107-
- postgresql-11-postgis-2.5
108-
109-
#MySQL 8 PHP 8.0
37+
#MySQL 8 PHP 8.1
11038
- stage: PHP8
11139
name: MySQL8
112-
php: 8.0
40+
php: 8.1
11341
env: DB=mysql.docker MYSQL_VERSION=8.0
11442
sudo: required
11543
services:
11644
- docker
11745
before_script:
11846
- bash ./tests/travis/install-mysql-8.0.sh
119-
#MySQLi 8 PHP 8.0
47+
#MySQLi 8 PHP 8.1
12048
- stage: PHP8
12149
name: MySQLi8
122-
php: 8.0
50+
php: 8.1
12351
env: DB=mysqli.docker MYSQL_VERSION=8.0
12452
sudo: required
12553
services:
12654
- docker
12755
before_script:
12856
- bash ./tests/travis/install-mysql-8.0.sh
129-
#PostgreSQL11 PHP 8.0 Postgis 2.5
57+
#PostgreSQL11 PHP 8.1 Postgis 2.5
13058
- stage: PHP8
13159
name: PostgreSQL11 Postgis 2.5
132-
php: 8.0
60+
php: 8.1
13361
env: DB=pgsql POSTGRESQL_VERSION=11.0
13462
sudo: required
13563
addons:

CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22
All notable changes to this project will be documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5-
## LongitudeOne/doctrine-spatial [3.0.0-dev]
5+
## LongitudeOne/doctrine-spatial [4.0.0-dev]
6+
7+
### Changed
8+
- longitude-one/wkt-parser replaces creof/wkt-parser
9+
10+
### Removed
11+
- Removing support of PHP7.4, PHP8.0
612

713
### TODO
814
- Support of CircleCI on Github actions (help is welcomed)
915
- Support for code coverage on Github Actions (help is welcomed)
1016

17+
18+
## LongitudeOne/doctrine-spatial [3.0.2] - 2022-02-16
19+
1120
### Added
1221
- longitude-one/doctrine-spatial replaces CrEOF/doctrine2-spatial
1322
- Support of PHP8.0

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ because project seems to be non-active since 2017.
3333
The `dev` branch can be used, but be careful backward compatibility aren't warrantied.
3434
The `main` branch will be dedicated to fix issue.
3535
The release 3.0 has been published during summer 2021.
36-
The release 3.1 will published during spring 2022.
37-
The release 4.0 will be published during winter 2022 and compatibility with PHP7.4 will be abandoned because of
36+
The release 4.0 will be published during spring 2023 and compatibility with PHP7.4 and 8.0 will be abandoned because of
3837
[PHP roadmap](https://www.php.net/supported-versions.php)
3938

4039
Compatibility
4140
-------------
4241
### PHP
43-
This doctrine extension is compatible with PHP 7.4+ and PHP 8.0
42+
This doctrine extension is compatible with PHP 8.1+
4443
Security fixes will follow the [PHP Roadmap](https://www.php.net/supported-versions.php).
4544

4645
### MySQL 5.7 and 8.0

composer.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
"creof/doctrine2-spatial": "*"
2424
},
2525
"require": {
26-
"php": "^7.4|^8.0",
26+
"php": "^8.1",
2727
"ext-json": "*",
2828
"ext-mbstring": "*",
2929
"creof/geo-parser": "~2.2",
30-
"creof/wkt-parser": "~2.2",
30+
"longitude-one/wkt-parser": "~1.0",
3131
"creof/wkb-parser": "~2.3",
3232
"doctrine/orm": "^2.8.4"
3333
},
@@ -68,5 +68,7 @@
6868
"LongitudeOne\\Spatial": "lib/",
6969
"LongitudeOne\\Spatial\\Tests": "tests/"
7070
}
71-
}
71+
},
72+
"repositories" : [
73+
]
7274
}

docker/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Docker
22
======
33

4-
This directory is only used to help the contributing developers. It creates a docker environment with PHP 7.4,
4+
This directory is only used to help the contributing developers. It creates a docker environment with PHP 8.1,
55
PostgreSQL/PostGis, MySQL5.7 and MySQL8.0. Feel free to use it or to use another solution.
66

77
How to start services?
@@ -15,7 +15,7 @@ docker exec spatial-php composer update
1515
How to start test
1616
-----------------
1717
```bash
18-
docker exec spatial-php cp docker/phpunit*.xml .
19-
docker exec spatial-php composer test-mysql5
20-
docker exec spatial-php composer test-mysql8
21-
docker exec spatial-php composer test-pgsql
18+
docker exec spatial-php8 cp docker/phpunit*.xml .
19+
docker exec spatial-php8 composer test-mysql5
20+
docker exec spatial-php8 composer test-mysql8
21+
docker exec spatial-php8 composer test-pgsql

docker/docker-compose.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ services:
66
context: ./php8
77
volumes:
88
- ${APP_FOLDER}:/var/www
9-
php7:
10-
container_name: "spatial-php7"
11-
build:
12-
context: ./php7
13-
volumes:
14-
- ${APP_FOLDER}:/var/www
159
database-pgsql:
1610
container_name: "spatial-postgis"
1711
image: postgis/postgis

docker/php7/Dockerfile

-19
This file was deleted.

docker/php8/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8-fpm-alpine
1+
FROM php:8.1-fpm-alpine
22

33
RUN apk --update --no-cache add bash git postgresql-dev mysql-dev \
44
&& docker-php-ext-install pdo_pgsql pdo_mysql \

docs/Configuration.rst

+7
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ You can register functions of the doctrine spatial extension adding them to the
127127
// This is another example to declare a Postgresql specific function which is returning a string
128128
$config->addCustomNumericFunction('SP_GeoJson', 'LongitudeOne\Spatial\ORM\Query\AST\Functions\PostgreSql\SpGeoJson');
129129
130+
Coordinates order
131+
-----------------
132+
133+
In point constructor, the order is the same as the spatial database.
134+
It means:
135+
* longitude shall be set before latitude in point constructor,
136+
* X shall be set before Y.
130137

131138
.. _ISO/IEC 13249-3:2016: https://www.iso.org/standard/60343.html
132139
.. _Open Geospatial Consortium: https://www.ogc.org/

docs/Contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Don't forget to check your code respect our standard of quality:
9494

9595
.. code-block:: bash
9696
97-
docker exec spatial-php7 composer check-quality-code
97+
docker exec spatial-php8 composer check-quality-code
9898
9999
How to test your new function?
100100
------------------------------

0 commit comments

Comments
 (0)