Skip to content

Commit

Permalink
Merge 0f7a374 into 58ea5fa
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre-T committed Feb 22, 2020
2 parents 58ea5fa + 0f7a374 commit bae1177
Show file tree
Hide file tree
Showing 234 changed files with 5,645 additions and 4,238 deletions.
9 changes: 4 additions & 5 deletions .gitignore
@@ -1,6 +1,5 @@
.phpcs-cache
.php_cs.cache
composer.lock
phpunit.xml
vendor/
composer.lock*
doctrine2-spatial.iml
.idea*
.idea/*
/nbproject
79 changes: 79 additions & 0 deletions .php_cs.dist
@@ -0,0 +1,79 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('var')
->exclude('vendor')
;

$header = <<<EOF
Copyright (C) 2020 Alexandre Tranchant
Copyright (C) 2015 Derek J. Lambert
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
EOF;

return PhpCsFixer\Config::create()
// ->setCacheFile(__DIR__.'/.php_cs.cache')
->setRules([
'@DoctrineAnnotation' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,
'@PHPUnit60Migration:risky' => true,
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'@PHP73Migration' => true,
// 'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
'dir_constant' => true,
'ereg_to_preg' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
'location' => 'after_open',
'separate' => 'bottom'
],
// 'date_time_immutable' => true,
// 'declare_strict_types' => true,
'is_null' => true,
'mb_str_functions' => true,
'modernize_types_casting' => true,
'no_unneeded_final_method' => true,
// 'no_alias_functions' =>true,
'ordered_interfaces' => [
'direction' => 'ascend',
'order' => 'alpha',
],
'ordered_class_elements' => [
'order' => [
'use_trait',
'constant_public', 'constant_protected', 'constant_private', 'constant',
'property_public_static', 'property_protected_static', 'property_private_static', 'property_static',
'property_public', 'property_protected', 'property_private', 'property',
'construct', 'destruct',
'phpunit',
'method_public_static', 'method_protected_static', 'method_private_static', 'method_static',
'method_public', 'method_protected', 'method_private', 'method', 'magic'
],
'sortAlgorithm' => 'alpha'
],
'single_line_throw' => false
])
->setFinder($finder)
;
36 changes: 24 additions & 12 deletions .travis.yml
Expand Up @@ -2,25 +2,35 @@ language: php

sudo: false

addons:
postgresql: '9.6'
apt:
packages:
- postgresql-9.6-postgis-2.5

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- hhvm

env:
- ORM=2.3
- ORM=2.4
- ORM=2.5
# Only stable and upcoming releases are tested https://www.doctrine-project.org/projects/orm.html
- ORM=2.7
- ORM=2.8
- ORM=3.0

before_script:
- export CC_TEST_REPORTER_ID=4ea3c7fddc36fb231ef19a43d186f1752b9195b8035bdcd4795769e9967e0f3c
- composer self-update
- cp ./composer.json ./tests/travis/composer.orm2.7.json
- cp ./tests/travis/composer.orm$ORM.json ./composer.json
- composer install --prefer-source
- mkdir -p ./build/coverage
# Test coverage for code climate
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build

script:
- ./vendor/bin/phpunit -v -c ./tests/travis/travis.pgsql.xml --coverage-php ./build/coverage/coverage-pgsql-$TRAVIS_PHP_VERSION-$ORM.cov
Expand All @@ -29,13 +39,15 @@ script:
after_script:
- ./vendor/bin/phpcov merge --clover ./build/logs/clover.xml ./build/coverage
- ./vendor/bin/coveralls -v --exclude-no-stmt
#Push code climate coverage
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

notifications:
webhooks: https://coveralls.io/webhook?repo_token=$COVERALLS_WEBHOOK

matrix:
allow_failures:
- php: hhvm # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
exclude:
- php: 5.3
env: ORM=2.5 # ORM >=2.5 requires PHP >=5.4
# Upcoming releases can fail
- env: ORM=2.8
- env: ORM=3.0
10 changes: 10 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- Needed PHP extension added in composer.json
- Project fork from creof/doctrine-spatial2
- Adding support of PHP7.2, PHP7.3, PHP7.4
- Removing deprecations of doctrine2
### Removed
- Removing support of PHP5.*, PHP7.0, PHP7.1

## [1.1.1] - 2020-02-21
Nota: This version was never published by creof. But the fork begins at this date.
### Added
- Added support for PostgreSql ST_MakeEnvelope function.
### Changed
- Added implementation of getTypeFamily() and getSQLType() to AbstractGeometryType.
Expand Down
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
@@ -1,7 +1,10 @@
(this is a work in progress)
Contributing
============

- Code formatting MUST follow PSR-2.
- Issues SHOULD include code and/or data to reproduce the issue.
- PR's for issues SHOULD include test(s) for issue.
- PR's SHOULD have adequate documentation (commit messages, comments, etc.) to readily convey what and/or why.
- Code SHOULD attempt to follow [Object Calisthenics](http://www.xpteam.com/jeff/writings/objectcalisthenics.rtf) methodology.
Quality of code is auto-verified by php-cs-fixer, php code sniffer and php mess detector.

Before a commit, launch the quality script:

```bash
composer quality
```
40 changes: 26 additions & 14 deletions README.md
@@ -1,26 +1,38 @@
# Doctrine2-Spatial
Doctrine2 multi-platform support for spatial types and functions.
Currently MySQL and PostgreSQL with PostGIS are supported.
Could potentially add support for other platforms if an interest is expressed.

[![Build Status](https://travis-ci.org/creof/doctrine2-spatial.svg?branch=master)](https://travis-ci.org/creof/doctrine2-spatial)
[![Code Climate](https://codeclimate.com/github/creof/doctrine2-spatial/badges/gpa.svg)](https://codeclimate.com/github/creof/doctrine2-spatial)
[![Coverage Status](https://coveralls.io/repos/creof/doctrine2-spatial/badge.svg?branch=master&service=github)](https://coveralls.io/github/creof/doctrine2-spatial?branch=master)
[![Downloads](https://img.shields.io/packagist/dm/creof/doctrine2-spatial.svg)](https://packagist.org/packages/creof/doctrine2-spatial)
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/creof/doctrine2-spatial)
## Project origins
This useful project was created by Derek J. Lambert.
Alexandre Tranchant forked it from [creof/doctrine2-spatial](https://github.com/creof/doctrine2-spatial)
because project seems to be unactive since 2017.

## Developments in progress
This fork will upgrade this package to the last doctrine version and the [PHP supported versions](https://www.php.net/supported-versions.php).

Doctrine2 multi-platform support for spatial types and functions. Currently MySQL and PostgreSQL with PostGIS are supported. Could potentially add support for other platforms if an interest is expressed.
Feel free to [contribute](./CONTRIBUTING.md)!

Documentation can be found at [here](./doc/index.md)
## Current status
[![Build Status](https://travis-ci.org/Alexandre-T/doctrine2-spatial.svg?branch=master)](https://travis-ci.org/Alexandre-T/doctrine2-spatial)
[![Code Climate](https://codeclimate.com/github/Alexandre-T/doctrine2-spatial/badges/gpa.svg)](https://codeclimate.com/github/Alexandre-T/doctrine2-spatial)
[![Coverage Status](https://coveralls.io/repos/Alexandre-T/doctrine2-spatial/badge.svg?branch=master&service=github)](https://coveralls.io/github/Alexandre-T/doctrine2-spatial?branch=master)
[![Downloads](https://img.shields.io/packagist/dm/Alexandre-T/doctrine2-spatial.svg)](https://packagist.org/packages/Alexandre-T/doctrine2-spatial)

## composer.json
```javascript
{
### [Documentation](./doc/index.md)

### Installation

Update your composer.json to add this package:
```yaml
"require": {
...
"creof/doctrine2-spatial": "~1"
....
"alexandret/doctrine2-spatial": "~1"
....
}
```

You will also have to change the version requirement of doctrine to at least 2.3:
```javascript

```yaml
"doctrine/orm": ">=2.3",
```
31 changes: 26 additions & 5 deletions composer.json
@@ -1,25 +1,46 @@
{
"name": "creof/doctrine2-spatial",
"name": "alexandret/doctrine2-spatial",
"type": "library",
"description": "Doctrine2 multi-platform support for spatial types and functions",
"keywords": ["orm", "dbal", "database", "postgresql", "mysql", "opengis", "postgis", "gis", "spatial", "geometry", "geography"],
"authors": [
{
"name": "Derek Lambert",
"email": "dlambert@dereklambert.com"
},
{
"name": "Alexandre Tranchant",
"email": "alexandre.tranchant@gmail.com"
}
],
"license": "MIT",
"require": {
"doctrine/orm": ">=2.3",
"php": "^7.2",
"ext-json": "*",
"ext-mbstring": "*",
"creof/geo-parser": "~2.0",
"creof/wkt-parser": "~2.0",
"creof/wkb-parser": "~2.0"
"creof/wkb-parser": "~2.0",
"doctrine/orm": "^2.7.0"
},
"require-dev": {
"phpunit/phpunit": "<5.0",
"friendsofphp/php-cs-fixer": "^2.16",
"phpmd/phpmd": "@stable",
"phpunit/phpunit": "*",
"phpunit/phpcov": "*",
"satooshi/php-coveralls": "~1.0"
"php-coveralls/php-coveralls": "~1.0",
"squizlabs/php_codesniffer": "3.*"
},
"scripts": {
"quality": [
"php-cs-fixer --config=.php_cs.dist fix --allow-risky=yes -vvv",
"phpcs --standard=phpcs.xml.dist -s",
"phpmd bin,config,public,src,tests text ./phpmd.xml.dist"
],
"phpcs": "phpcs --standard=phpcs.xml.dist -s",
"phpcsfixer": "php-cs-fixer --config=.php_cs.dist fix --allow-risky=yes -vvv",
"phpmd": "phpmd bin,config,public,src,tests text ./phpmd.xml.dist",
"test": "phpunit"
},
"autoload": {
"psr-0": {
Expand Down

0 comments on commit bae1177

Please sign in to comment.