Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Aug 17, 2021
0 parents commit 71ca2a5
Show file tree
Hide file tree
Showing 72 changed files with 2,493 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.gitattributes export-ignore
.gitignore export-ignore
.github/ export-ignore
phpunit.xml export-ignore
phpunit-bootstrap.php export-ignore
psalm.xml export-ignore
README.md export-ignore
tests/ export-ignore
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: BenMorel
249 changes: 249 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
name: CI

on:
push:
pull_request:

jobs:
psalm:
name: Psalm
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"

- name: Install composer dependencies
uses: "ramsey/composer-install@v1"

- name: Run Psalm
run: vendor/bin/psalm --show-info=false --find-unused-psalm-suppress --no-progress

phpunit-mysql:
name: PHPUnit MySQL
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
emulate-prepares:
- "ON"
- "OFF"

services:
mysql:
image: "mysql:8.0"
ports:
- "3306:3306"
options: >-
--health-cmd "mysqladmin ping --silent"
-e MYSQL_ALLOW_EMPTY_PASSWORD=true
--entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo_mysql
coverage: xdebug

- name: Install composer dependencies
uses: "ramsey/composer-install@v1"

- name: Run PHPUnit
run: vendor/bin/phpunit
env:
ENGINE: PDO_MYSQL
EMULATE_PREPARES: ${{ matrix.emulate-prepares }}
if: ${{ matrix.php-version != '8.0' }}

- name: Run PHPUnit with coverage
run: |
mkdir -p mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
ENGINE: PDO_MYSQL
EMULATE_PREPARES: ${{ matrix.emulate-prepares }}
if: ${{ matrix.php-version == '8.0' }}

- name: Upload coverage report to Coveralls
run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.php-version == '8.0' }}

phpunit-mariadb:
name: PHPUnit MariaDB
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- "8.0"
emulate-prepares:
- "ON"
- "OFF"

services:
mariadb:
image: "mariadb:10.1"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
options: >-
--health-cmd "mysqladmin ping --silent"
ports:
- "3306:3306"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo_mysql
coverage: xdebug

- name: Install composer dependencies
uses: "ramsey/composer-install@v1"

- name: Run PHPUnit with coverage
run: |
mkdir -p mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
ENGINE: PDO_MYSQL
EMULATE_PREPARES: ${{ matrix.emulate-prepares }}

- name: Upload coverage report to Coveralls
run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

phpunit-postgres:
name: PHPUnit PostgreSQL
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- "8.0"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PostgreSQL with PostGIS
uses: huaxk/postgis-action@v1
with:
postgresql version: 'latest'
postgresql password: 'postgres'
postgresql user: 'postgres'

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo_pgsql
coverage: xdebug

- name: Install composer dependencies
uses: "ramsey/composer-install@v1"

- name: Run PHPUnit with coverage
run: |
mkdir -p mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
ENGINE: PDO_PGSQL

- name: Upload coverage report to Coveralls
run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

phpunit-sqlite:
name: PHPUnit SQLite
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- "8.0"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: sqlite3
ini-values: sqlite3.extension_dir=/usr/lib/x86_64-linux-gnu
coverage: xdebug

- name: Install SpatiaLite
run: sudo apt install libsqlite3-mod-spatialite

- name: Install composer dependencies
uses: "ramsey/composer-install@v1"

- name: Run PHPUnit with coverage
run: |
mkdir -p mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
ENGINE: SQLite3

- name: Upload coverage report to Coveralls
run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

phpunit-geos:
name: PHPUnit GEOS
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: geos
coverage: xdebug

- name: Install composer dependencies
uses: "ramsey/composer-install@v1"

- name: Run PHPUnit with coverage
run: |
mkdir -p mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
ENGINE: GEOS

- name: Upload coverage report to Coveralls
run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor
/composer.lock
/.phpunit.result.cache
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2013-present Benjamin Morel

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.
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
brick/geo-doctrine
==================

<img src="https://raw.githubusercontent.com/brick/brick/master/logo.png" alt="" align="left" height="64">

Doctrine types & functions for [brick/geo](https://github.com/brick/geo)

[![Build Status](https://github.com/brick/geo-doctrine/workflows/CI/badge.svg)](https://github.com/brick/geo-doctrine/actions)
[![Coverage Status](https://coveralls.io/repos/github/brick/geo-doctrine/badge.svg?branch=master)](https://coveralls.io/github/brick/geo-doctrine?branch=master)
[![Latest Stable Version](https://poser.pugx.org/brick/geo-doctrine/v/stable)](https://packagist.org/packages/brick/geo-doctrine)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)

Introduction
------------

This library provides:

- type mappings to use `brick/geo` objects such as `Polygon` as Doctrine entity properties
- functions to use in DQL queries, such as `Distance()` or `Contains()`.

Installation
------------

This library is installable via [Composer](https://getcomposer.org/):

```bash
composer require brick/geo-doctrine
```

Requirements
------------

This library requires PHP 7.4 or PHP 8.

Project status & release process
--------------------------------

The current releases are numbered `0.x.y`. When a non-breaking change is introduced (adding new methods, optimizing existing code, etc.), `y` is incremented.

**When a breaking change is introduced, a new `0.x` version cycle is always started.**

It is therefore safe to lock your project to a given release cycle, such as `0.1.*`.

If you need to upgrade to a newer release cycle, check the [release history](https://github.com/brick/geo-doctrine/releases) for a list of changes introduced by each further `0.x.0` version.

Package contents
----------------

### Types

- [GeometryCollectionType](https://github.com/brick/geo-doctrine/blob/master/src/Types/GeometryCollectionType.php)
- [GeometryType](https://github.com/brick/geo-doctrine/blob/master/src/Types/GeometryType.php)
- [LineStringType](https://github.com/brick/geo-doctrine/blob/master/src/Types/LineStringType.php)
- [MultiLineStringType](https://github.com/brick/geo-doctrine/blob/master/src/Types/MultiLineStringType.php)
- [MultiPointType](https://github.com/brick/geo-doctrine/blob/master/src/Types/MultiPointType.php)
- [MultiPolygonType](https://github.com/brick/geo-doctrine/blob/master/src/Types/MultiPolygonType.php)
- [PointType](https://github.com/brick/geo-doctrine/blob/master/src/Types/PointType.php)
- [PolygonType](https://github.com/brick/geo-doctrine/blob/master/src/Types/PolygonType.php)

### Functions

Complete list [here](https://github.com/brick/geo-doctrine/blob/master/src/Functions).
32 changes: 32 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "brick/geo-doctrine",
"description": "Doctrine types & functions for brick/geo",
"type": "library",
"keywords": [
"Brick",
"Geo",
"Doctrine"
],
"license": "MIT",
"require": {
"brick/geo": "dev-master",
"doctrine/orm": "^2.0"
},
"require-dev": {
"doctrine/data-fixtures": "^1.0",
"phpunit/phpunit": "^8.0 || ^9.0",
"php-coveralls/php-coveralls": "^2.0",
"vimeo/psalm": "4.3.1"
},
"autoload": {
"psr-4": {
"Brick\\Geo\\Doctrine\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"": "stubs/",
"Brick\\Geo\\Doctrine\\Tests\\": "tests/"
}
}
}
Loading

0 comments on commit 71ca2a5

Please sign in to comment.