Skip to content

Commit

Permalink
Merge branch 'v6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Breu committed Mar 1, 2024
2 parents 3e1487e + 7f12b15 commit bee4abb
Show file tree
Hide file tree
Showing 99 changed files with 299 additions and 376 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/docker export-ignore
/travis export-ignore
/tests/.cache export-ignore
.env.dist export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php_cs export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
CONTRIBUTING.md export-ignore
docker-compose.yml export-ignore
phpunit.ci.xml export-ignore
Expand Down
45 changes: 33 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,37 @@ on:
pull_request: ~
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
workflow_dispatch: ~

jobs:
tests:
runs-on: ubuntu-latest

name: "PHP ${{ matrix.php }}"
name: PHP ${{ matrix.php }} - ${{ matrix.symfony-version }} - ${{ matrix.stability }}

strategy:
fail-fast: false
matrix:
php: [8.0, 8.1, 8.2, 8.3]
php: [8.3]
stability: [ prefer-stable ]
symfony-version: [ '7.0.*' ]
include:
- php: '8.1'
symfony-version: 6.4.*
stability: prefer-lowest
- php: '8.1'
symfony-version: 6.4.*
stability: prefer-stable
- php: '8.2'
symfony-version: 6.4.*
stability: prefer-stable
- php: '8.2'
symfony-version: 7.0.*
stability: prefer-stable
- php: '8.3'
symfony-version: 7.0.*
stability: prefer-stable


env:
APP_ENV: test
Expand Down Expand Up @@ -53,7 +69,12 @@ jobs:
-
name: Install PHP dependencies
run: composer install --no-interaction --prefer-source
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins symfony/flex
composer update --no-interaction --prefer-dist
-
name: Run analysis
Expand All @@ -63,9 +84,9 @@ jobs:
name: Run PHPUnit
run: vendor/bin/phpunit --configuration phpunit.ci.xml --coverage-clover clover.xml

-
name: Send coverage report
if: github.repository == 'bresam/ivory-google-map'
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover clover.xml
#-
#name: Send coverage report
#if: github.repository == 'bresam/ivory-google-map'
#run: |
#wget https://scrutinizer-ci.com/ocular.phar
#php ocular.phar code-coverage:upload --format=php-clover clover.xml
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ If you're here, you are going to fix a bug and you're the best! To do it, first
create a new branch with the following commands:

``` bash
$ git clone [email protected]:your-name/ivory-google-map.git
$ git checkout -b bug-fix-description
git clone [email protected]:your-name/ivory-google-map.git
git checkout -b bug-fix-description
```

Then, we recommend to use [Docker](https://www.docker.com) and follow this [instructions](/doc/development_environment.md) in order to
Expand All @@ -41,21 +41,21 @@ it immediately. Before, you will need to add tests and update the doc. For the t
When you have fixed the bug, tested it and documented it, you can commit and push it with the following commands:

``` bash
$ git commit -m "Bug fix description"
$ git push origin bug-fix-description
git commit -m "Bug fix description"
git push origin bug-fix-description
```

If you have reworked you patch, please squash all your commits in a single one with the following commands (here, we
will assume you would like to squash 3 commits in a single one):

``` bash
$ git rebase -i HEAD~3
git rebase -i HEAD~3
```

If your branch conflicts with the master branch, you will need to rebase and repush it with the following commands:

``` bash
$ git remote add upstream [email protected]:bresam/ivory-google-map.git
$ git pull --rebase upstream master
$ git push origin bug-fix-description -f
git remote add upstream [email protected]:bresam/ivory-google-map.git
git pull --rebase upstream master
git push origin bug-fix-description -f
```
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# README

[![Travis Build Status](https://api.travis-ci.com/bresam/ivory-google-map.svg?branch=master)](https://travis-ci.com/github/bresam/ivory-google-map)
[![Build](https://github.com/bresam/ivory-google-map/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/bresam/ivory-google-map/actions/workflows/build.yml)
[![Code Coverage](https://scrutinizer-ci.com/g/bresam/ivory-google-map/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/bresam/ivory-google-map/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bresam/ivory-google-map/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/bresam/ivory-google-map/?branch=master)

## Quickstart
[Packagist: ivory/google-map](https://packagist.org/packages/ivory/google-map)

```composer require ivory/google-map```
``` bash
composer require ivory/google-map
```

### Symfony Bundle
[Github: ivory/google-map-bundle](https://github.com/bresam/ivory-google-map-bundle)

[Packagist: ivory/google-map-bundle](https://packagist.org/packages/ivory/google-map-bundle)

```composer require ivory/google-map-bundle```
``` bash
composer require ivory/google-map-bundle
```

### Contao Bundle

Expand Down Expand Up @@ -94,8 +98,7 @@ echo $apiHelper->render([$map]);

## Testing

The library is fully unit tested by [PHPUnit](http://www.phpunit.de/) with a code coverage close to **100%**. To
execute the test suite, check the travis [configuration](/.travis.yml).
The library is fully unit tested by [PHPUnit](http://www.phpunit.de/) with a code coverage close to **100%**.

## Contribute

Expand Down
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ivory/google-map",
"description": "Google Map API v3 integration for PHP ^8.0",
"description": "Google Map API v3 integration for PHP",
"keywords": [ "google", "map"],
"license": "MIT",
"authors": [
Expand All @@ -16,21 +16,21 @@
}
],
"require": {
"php": "^8.0",
"doctrine/annotations": "^1.13 || ^2.0",
"symfony/event-dispatcher": "^5.0 || ^6.0 || ^7.0",
"symfony/serializer": "^5.0 || ^6.0 || ^7.0",
"symfony/property-access": "^5.0 || ^6.0 || ^7.0",
"phpdocumentor/reflection-docblock": "^5.3"
"php": "^8.1",
"symfony/event-dispatcher": "^6.4 || ^7.0",
"symfony/serializer": "^6.4 || ^7.0",
"symfony/property-access": "^6.4 || ^7.0",
"phpdocumentor/reflection-docblock": "^5.3",
"php-http/message-factory": "^1.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"php-http/cache-plugin": "^1.4",
"php-http/guzzle6-adapter": "^2.0",
"phpunit/phpunit": "^8.5 || ^9.6",
"phpunit/phpunit-selenium": "^8.0 || ^9.0",
"symfony/cache": "^5.0 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^5.0 || ^6.0 || ^7.0",
"friendsofphp/php-cs-fixer": "^3.49",
"php-http/cache-plugin": "^2.0",
"php-http/guzzle7-adapter": "^1.0",
"phpunit/phpunit": "^9.6.16",
"phpunit/phpunit-selenium": "^9.0",
"symfony/cache": "^6.4 || ^7.0",
"symfony/phpunit-bridge": "^6.4 || ^7.0",
"ext-json": "*"
},
"suggest": {
Expand Down
12 changes: 6 additions & 6 deletions doc/development_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ The most easy way to set up the project is to install [Docker](https://www.docke
## Configure

``` bash
$ cp .env.dist .env
$ cp phpunit.xml.dist phpunit.xml
cp .env.dist .env
cp phpunit.xml.dist phpunit.xml
```
Add proper credentials in `phpunit.xml`

Expand All @@ -27,29 +27,29 @@ These Endpoints are used:
Once you have configured your environment, you can build the project:

``` bash
$ docker-compose build
docker-compose build
```

## Composer

Install the dependencies via [Composer](https://getcomposer.org/):

``` bash
$ docker-compose run --rm php composer install
docker-compose run --rm php composer install
```

## Tests

To start the test suite, you can use:

``` bash
$ docker-compose up -d
docker-compose up -d
```

To run phpunit:

``` bash
$ docker exec ivory-google-map_php_1 vendor/bin/phpunit
docker exec ivory-google-map_php_1 vendor/bin/phpunit
```

## Tests with PHP Storm integration
Expand Down
17 changes: 6 additions & 11 deletions doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@ you.

## Set up Composer

Composer comes with a simple phar file. To easily access it from anywhere on your system, you can execute:

``` bash
$ curl -s https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
```
[Install Composer](https://getcomposer.org/)

## Download the library

Require the library in your `composer.json` file:

``` bash
$ composer require ivory/google-map
composer require ivory/google-map
```

## Download additional libraries
Expand All @@ -29,11 +24,11 @@ If you want to use a service (geocoder, direction, ...), you will need an http c
[Httplug](http://httplug.io/) which is an http client abstraction library:

``` bash
$ composer require php-http/guzzle6-adapter
$ composer require php-http/message
composer require php-http/guzzle7-adapter
composer require php-http/message
```

Here, I have chosen to use [Guzzle6](http://docs.guzzlephp.org/en/latest/psr7.html) but since Httplug supports the
Here, I have chosen to use [Guzzle7](http://docs.guzzlephp.org/en/latest/psr7.html) but since Httplug supports the
most popular http clients, you can install your preferred one instead.

### Ivory Serializer
Expand All @@ -42,7 +37,7 @@ If you want to use a service (geocoder, direction, ...), you will need the
[Ivory Serializer](https://github.com/egeloen/ivory-serializer) in order to deserialize the http response:

``` bash
$ composer require egeloen/serializer
composer require egeloen/serializer
```

## Autoload
Expand Down
6 changes: 3 additions & 3 deletions doc/service/direction/direction.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ First of all, if you want to route a direction, you will need to build a directi

``` php
use Ivory\GoogleMap\Service\Direction\DirectionService;
use Http\Adapter\Guzzle6\Client;
use Http\Adapter\Guzzle7\Client;
use Http\Message\MessageFactory\GuzzleMessageFactory;

$direction = new DirectionService(new Client(), new GuzzleMessageFactory());
```

The direction constructor requires an `HttpClient` as first argument and a `MessageFactory` as second argument. Here,
I have chosen to use the [Guzzle6](http://docs.guzzlephp.org/en/latest/psr7.html) client as well as the Guzzle message
I have chosen to use the [Guzzle7](http://docs.guzzlephp.org/en/latest/psr7.html) client as well as the Guzzle message
factory. Httplug supports the most popular http clients, so, you can choose you preferred one instead.

The direction constructor also accepts a `SerializerInterface` as third argument. It is highly recommended to use it
Expand All @@ -33,7 +33,7 @@ in order to configure a PSR-6 cache pool and so avoid parsing the built-in metad
``` php
use Ivory\GoogleMap\Service\Direction\DirectionService;
use Ivory\GoogleMap\Service\Serializer\SerializerBuilder;
use Http\Adapter\Guzzle6\Client;
use Http\Adapter\Guzzle7\Client;
use Http\Message\MessageFactory\GuzzleMessageFactory;

$direction = new DirectionService(
Expand Down
6 changes: 3 additions & 3 deletions doc/service/distance_matrix/distance_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ First of all, if you want to process a distance matrix, you will need to build a

``` php
use Ivory\GoogleMap\Service\DistanceMatrix\DistanceMatrixService;
use Http\Adapter\Guzzle6\Client;
use Http\Adapter\Guzzle7\Client;
use Http\Message\MessageFactory\GuzzleMessageFactory;

$distanceMatrix = new DistanceMatrixService(new Client(), new GuzzleMessageFactory());
```

The distance matrix constructor requires an `HttpClient` as first argument and a `MessageFactory` as second argument.
Here, I have chosen to use the [Guzzle6](http://docs.guzzlephp.org/en/latest/psr7.html) client as well as the Guzzle
Here, I have chosen to use the [Guzzle7](http://docs.guzzlephp.org/en/latest/psr7.html) client as well as the Guzzle
message factory. Httplug supports the most popular http clients, so, you can choose you preferred one instead.

The distance matrix constructor also accepts a `SerializerInterface` as third argument. It is highly recommended to
Expand All @@ -35,7 +35,7 @@ use it in order to configure a PSR-6 cache pool and so avoid parsing the built-i
``` php
use Ivory\GoogleMap\Service\DistanceMatrix\DistanceMatrixService;
use Ivory\GoogleMap\Service\Serializer\SerializerBuilder;
use Http\Adapter\Guzzle6\Client;
use Http\Adapter\Guzzle7\Client;
use Http\Message\MessageFactory\GuzzleMessageFactory;

$distanceMatrix = new DistanceMatrixService(
Expand Down
Loading

0 comments on commit bee4abb

Please sign in to comment.