-
Notifications
You must be signed in to change notification settings - Fork 522
<
8000
div class="d-flex flex-column flex-md-row flex-items-start flex-md-items-center">
Use numbered administrative level instead of named one #398
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
Merged
willdurand
merged 17 commits into
geocoder-php:master
from
giosh94mhz:numbered_admin_levels
Feb 13, 2015
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c888d7c
GeoIP2 results use underscore case
giosh94mhz b280be5
Fix Geocoder type hint
giosh94mhz 10bd7c3
Add AddressFactory type hint
giosh94mhz 12d59a7
AddressCollection::first type hint
giosh94mhz fa52e57
ProviderAggregator always return AddressCollection
giosh94mhz 3678742
Remove useless @ from GeonamesTest
giosh94mhz e918322
AddressCollection contructor docblock
giosh94mhz 204a3fd
Add AddressCollection::has predicate
giosh94mhz 813b270
TomTom provider: handle "Developer Inactive" error
giosh94mhz 58e5def
Replace County and Region with AdminLevels
giosh94mhz 012cc59
Fix localhost default tests
giosh94mhz 32f4544
Avoid null object in StringFormatter
giosh94mhz 6ae5a6d
OpenStreetMap fix postal code and tests
giosh94mhz 9366ff1
Fix Gpx dumper for adminLevels
giosh94mhz 34284c2
Http cache hashing doesn't depend from apikey
giosh94mhz 990ab98
Yandex Provider support 2 admin levels (+minor fixes)
giosh94mhz 11ccbc4
Minor syntax fixes
giosh94mhz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replace County and Region with AdminLevels
- Loading branch information
commit 58e5defcba5b249e70b8d5091267b750995cac13
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Geocoder package. | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @license MIT License | ||
*/ | ||
|
||
namespace Geocoder\Exception; | ||
|
||
/** | ||
* @author Giorgio Premi <giosh94mhz@gmail.com> | ||
*/ | ||
class UnexpectedValue extends \UnexpectedValueException implements Exception | ||
{ | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,13 @@ | |
/** | ||
* @author William Durand <william.durand1@gmail.com> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not removed, the IDE changed to my tag author during the refactoring. I'll revert it anyway, no problem. |
||
*/ | ||
final class County | ||
final class AdminLevel | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
private $level; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
|
@@ -26,17 +31,29 @@ final class County | |
private $code; | ||
|
||
/** | ||
* @param int $level | ||
* @param string $name | ||
* @param string $code | ||
*/ | ||
public function __construct($name, $code) | ||
public function __construct($level, $name, $code) | ||
{ | ||
$this->level = $level; | ||
$this->name = $name; | ||
$this->code = $code; | ||
} | ||
|
||
/** | ||
* Returns the country name | ||
* Returns the administrative level | ||
* | ||
* @return int Level number [1,5] | ||
*/ | ||
public function getLevel() | ||
{ | ||
return $this->level; | ||
} | ||
|
||
/** | ||
* Returns the administrative level name | ||
* | ||
* @return string | ||
*/ | ||
|
@@ -46,7 +63,7 @@ public function getName() | |
} | ||
|
||
/** | ||
* Returns the county short name. | ||
* Returns the administrative level short name. | ||
* | ||
* @return string | ||
*/ | ||
|
@@ -56,7 +73,7 @@ public function getCode() | |
} | ||
|
||
/** | ||
* Returns a string with the county name. | ||
* Returns a string with the administrative level name. | ||
* | ||
* @return string | ||
*/ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we return a null object or only null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you mean, since the returned value is the formatted string.
Here I've used a null object just to avoid two cycle: the first to set all ADMIN_LEVEL_*
$tr
to null, and the second (foreach adminLevels) to set the actual value for the address. SinceAdminLevel
class is final there should be no problem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please avoid this null object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no prob.