Skip to content

Commit

Permalink
Code clean, README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jguittard committed Oct 15, 2016
1 parent a004939 commit ffcf30e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
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
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"dev-develop": "2.0-dev"
},
"zf": {
"module": "ZF\\GeoCoder"
"module": "ZF\\Geocoder"
}
},
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions src/Factory/GeocoderAbstractFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class GeocoderAbstractFactory implements AbstractFactoryInterface
* @param string $name Normalized name by which service was requested;
* ignored.
* @param string $requestedName Name by which service was requested, must
* start with ZF\Geocoder\
* start with Geocoder\
* @return bool
*/
public function canCreateServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)
Expand All @@ -72,7 +72,7 @@ public function canCreateServiceWithName(ServiceLocatorInterface $container, $na
* @param string $name Normalized name by which service was requested;
* ignored.
* @param string $requestedName Name by which service was requested, must
* start with Zend\Navigation\
* start with Geocoder\
* @return \Geocoder\Provider\AbstractProvider
*/
public function createServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)
Expand Down Expand Up @@ -190,7 +190,6 @@ private function getConfigName($name)
*/
private function hasNamedConfig($name, $config)
{
//return (array_search($this->toUnderscore($parts[1]), array_keys($config['providers'])) !== false);
$withoutPrefix = $this->getConfigName($name);

if (isset($config[$withoutPrefix])) {
Expand Down

0 comments on commit ffcf30e

Please sign in to comment.