Skip to content

Commit 0280b03

Browse files
committed
Add more doc. Fix #242
1 parent 4d267e8 commit 0280b03

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Contributing
2+
============
3+
4+
First of all, thank you for contributing, you are awesome! Here are a few rules
5+
to follow in order to ease code reviews, and discussions before maintainers
6+
accept and merge your work.
7+
8+
You MUST follow the [PSR-1](http://www.php-fig.org/psr/1/) and
9+
[PSR-2](http://www.php-fig.org/psr/2/). If you don't know about any of them, you
10+
should really read the recommendations. Can't wait? Use the [PHP-CS-Fixer
11+
tool](http://cs.sensiolabs.org/).
12+
13+
You MUST run the test suite.
14+
15+
You MUST write (or update) unit tests.
16+
17+
You SHOULD write documentation.
18+
19+
Please, write [commit messages that make
20+
sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
21+
and [rebase your branch](http://git-scm.com/book/en/Git-Branching-Rebasing)
22+
before submitting your Pull Request.
23+
24+
One may ask you to [squash your
25+
commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)
26+
too. This is used to "clean" your Pull Request before merging it (we don't want
27+
commits such as `fix tests`, `fix 2`, `fix 3`, etc.).
28+
29+
Thank you!

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ The Geocoder's API is fluent, you can write:
410410
$result = $geocoder
411411
->registerProvider(new \My\Provider\Custom($adapter))
412412
->using('custom')
413+
->limit(10)
413414
->geocode('68.145.37.34')
414415
;
415416
```
@@ -418,6 +419,11 @@ The `using()` method allows you to choose the `provider` to use by its name.
418419
When you deal with multiple providers, you may want to choose one of them.
419420
The default behavior is to use the first one but it can be annoying.
420421

422+
The `limit()` method allows you to configure the maximum number of results
423+
being returned. Depending on the provider you may not get as many results as
424+
expected, it is a maximum limit, not the expected number of results.
425+
426+
421427
Reverse Geocoding
422428
-----------------
423429

@@ -555,6 +561,12 @@ You can provide your own `dumper` by implementing the `DumperInterface`.
555561
Write your own `formatter` by implementing the `FormatterInterface`.
556562

557563

564+
Contributing
565+
------------
566+
567+
See CONTRIBUTING file.
568+
569+
558570
Unit Tests
559571
----------
560572

src/Geocoder/Geocoder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ class Geocoder implements GeocoderInterface
5454
* @param ResultFactoryInterface $resultFactory
5555
* @param integer $maxResults
5656
*/
57-
public function __construct(ProviderInterface $provider = null, ResultFactoryInterface $resultFactory = null,
58-
$maxResults = self::MAX_RESULTS)
57+
public function __construct(ProviderInterface $provider = null, ResultFactoryInterface $resultFactory = null, $maxResults = self::MAX_RESULTS)
5958
{
6059
$this->provider = $provider;
6160

0 commit comments

Comments
 (0)