Skip to content

ZF3 compliant module #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.5
- 5.6
- 7
- hhvm
Expand Down
21 changes: 1 addition & 20 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

namespace ZF\Geocoder;

use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;

/**
* Class Module
*
Expand All @@ -14,24 +11,8 @@
* @license https://opensource.org/licenses/BSD-3-Clause New BSD License
* @link http://github.com/jguittard/geocodermodule for the canonical source repository
*/
class Module implements AutoloaderProviderInterface, ConfigProviderInterface
class Module
{
/**
* Return an array for passing to Zend\Loader\AutoloaderFactory.
*
* @return array
*/
public function getAutoloaderConfig()
{
return [
'Zend\Loader\StandardAutoloader' => [
'namespaces' => [
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
],
],
];
}

/**
* Returns configuration to merge with application configuration
*
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Geocoder for Zend Framework 2
Geocoder for Zend Framework
===

This package allows you to use [**Geocoder**](http://geocoder-php.org/Geocoder/) in [**Zend Framework 2**](http://framework.zend.com/)
This package allows you to use [**Geocoder**](http://geocoder-php.org/Geocoder/) in [**Zend Framework**](http://framework.zend.com/).

_It is still compatible with Zend Framework 2 and 3 Service Manager._

Requirements
------------
Expand All @@ -14,14 +16,14 @@ Installation
Run the following `composer` command:

```console
$ composer require "jguittard/zf-geocoder:~1.0-dev"
$ composer require "jguittard/zf-geocoder:~1.0"
```

Alternately, manually add the following to your `composer.json`, in the `require` section:

```javascript
"require": {
"jguittard/zf-geocoder": "~1.0-dev"
"jguittard/zf-geocoder": "~1.0"
}
```

Expand All @@ -41,6 +43,11 @@ return array(
);
```

Or rely on [**Zend Component Installer**](http://github.com/zendframework/zend-component-installer) to inject this module automatically
```console
composer require zendframework/zend-composer-installer:^0.4
```

Configuration
-------------
Copy the `config/zf.geocoder.local.php.dist` to the `config/autoload` directory and remove the `dist` extension to jump start configuration.
Expand All @@ -49,7 +56,7 @@ Usage
-----
You can retrieve Geocoder documentation

The following will handle setup and service management within this Zend Framework 2 module.
The following will handle setup and service management within this Zend Framework module.

First, make sure you have set up your configuration file by commenting out the provider(s) you'd like to use.

Expand Down Expand Up @@ -93,10 +100,15 @@ composer install --dev
```
Run the unit tests
```console
./vendor/bin/phpunit
composer test
```

Code styling check
```console
./vendor/bin/phpcs
composer cs-check
```

Check both
```console
composer check
```
50 changes: 35 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"name" : "jguittard/zf-geocoder",
"description" : "Geocoder Service module for Zend Framework 2",
"description" : "Geocoder Service module for Zend Framework",
"type" : "library",
"keywords" : ["zf2", "geocoder", "geocoding"],
"keywords" : ["zf", "geocoder", "geocoding"],
"homepage" : "http://github.com/jguittard/geocodermodule",
"license" : "BSD-3-Clause",
"authors" : [{
"name" : "Julien Guittard",
"email" : "julien.guittard@me.com",
"homepage" : "http://julienguittard.com",
"homepage" : "https://julienguittard.com",
"role" : "Developer"
}],
"require" : {
"php" : ">=5.4",
"php" : "5.6 || ^7.0",
"willdurand/geocoder": "^3.3",
"php-http/httplug": "^0.1.0",
"zendframework/zend-stdlib": "~2.5",
"zendframework/zend-http": "~2.5",
"zendframework/zend-servicemanager": "~2.5",
"zendframework/zend-config": "~2.5",
"zendframework/zend-filter": "~2.5",
"zendframework/zend-serializer": "~2.5",
"zendframework/zend-modulemanager": "~2.5",
"zendframework/zend-i18n": "~2.5"
"zendframework/zend-stdlib": "^2.7 || ^3.0",
"zendframework/zend-http": "^2.5",
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
"zendframework/zend-config": "^2.6",
"zendframework/zend-filter": "^2.7",
"zendframework/zend-serializer": "^2.7",
"zendframework/zend-i18n": "^2.7"
},
"require-dev" : {
"phpunit/phpunit" : "~4.5.0",
"phpunit/phpunit" : "~5.5",
"squizlabs/php_codesniffer" : "~2.3.4",
"zendframework/zend-test" : "~2.5",
"zendframework/zend-log": "~2.5"
"zendframework/zend-test" : "~3.0",
"zendframework/zend-log": "^2.7",
"friendsofphp/php-cs-fixer": "^1.12"
},
"autoload" : {
"psr-4": {
Expand All @@ -42,5 +42,25 @@
"psr-4": {
"ZFTest\\Geocoder\\" : "test/"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev",
"dev-develop": "2.0-dev"
},
"zf": {
"module": "ZF\\Geocoder"
}
},
"scripts": {
"check": [
"@cs-check",
"@test"
],
"upload-coverage": "coveralls -v",
"cs-check": "php-cs-fixer --version && php-cs-fixer fix -v --diff --dry-run",
"cs-fix": "php-cs-fixer fix -v",
"test": "phpunit",
"test-coverage": "phpunit --coverage-clover clover.xml"
}
}
Loading