Skip to content

Commit 7607ec8

Browse files
committed
Fix getProvider() method
1 parent e97a21e commit 7607ec8

File tree

3 files changed

+31
-15
lines changed

3 files changed

+31
-15
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [4.0.1] - 2 Sep 2017
6+
### Fixed
7+
- erroneous method `getProvider()` and marked it as deprecated.
8+
59
## [4.0.0] - 3 Aug 2017
10+
### Added
11+
- Laravel 5.5 package auto-discovery.
12+
613
### Fixed
714
- typo which caused cache to be in-effective.
815

README.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ This package allows you to use [**Geocoder**](http://geocoder-php.org/Geocoder/)
2222

2323
## Installation
2424
1. Install the package via composer:
25-
```sh
26-
composer require toin0u/geocoder-laravel
27-
```
28-
29-
2. **If you are running Laravel 5.5, skip this step.** Find the `providers` array key in `config/app.php` and register the **Geocoder Service Provider**:
30-
```php
31-
// 'providers' => [
32-
Geocoder\Laravel\Providers\GeocoderService::class,
33-
// ];
34-
```
25+
```sh
26+
composer require toin0u/geocoder-laravel
27+
```
28+
29+
2. **If you are running Laravel 5.5 (the package will be auto-discovered), skip
30+
this step.** Find the `providers` array key in `config/app.php` and register
31+
the **Geocoder Service Provider**:
32+
```php
33+
// 'providers' => [
34+
Geocoder\Laravel\Providers\GeocoderService::class,
35+
// ];
36+
```
3537

3638
## Upgrading
3739
Anytime you upgrade this package, please remember to clear your cache, to prevent incompatible cached responses when breaking changes are introduced (this should hopefully only be necessary in major versions):
@@ -60,9 +62,13 @@ Also, `getProviders()` now returns a Laravel Collection instead of an array.
6062
needed. Simply iterate over your results as you would any other Laravel
6163
collection.
6264

63-
**Deprecated:** the `all()` method on the geocoder is being deprecated in favor
64-
of using `get()`, which will return a Laravel Collection. You can then run
65-
`all()` on that. This method will be removed in version 3.0.0.
65+
**Deprecated:**
66+
- the `all()` method on the geocoder is being deprecated in favor of using
67+
`get()`, which will return a Laravel Collection. You can then run `all()`
68+
on that. This method will be removed in version 5.0.0.
69+
- the `getProvider()` method on the geocoder is being deprecated in favor of using
70+
`getProviders()`, which will return a Laravel Collection. You can then run `first()`
71+
on that to get the same result. This method will be removed in version 5.0.0.
6672

6773
**Added:** this version introduces a new way to create more complex queries:
6874
- geocodeQuery()

src/ProviderAndDumperAggregator.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,12 @@ public function getProviders() : Collection
178178
return collect($this->aggregator->getProviders());
179179
}
180180

181-
protected function getProvider()
181+
/**
182+
* @deprecated Use `getProviders()` instead.
183+
*/
184+
public function getProvider()
182185
{
183-
return $this->aggregator->getProvider();
186+
return $this->getProviders()->first();
184187
}
185188

186189
public function registerProvidersFromConfig(Collection $providers) : self

0 commit comments

Comments
 (0)