diff options
author | mattab <matthieu.aubry@gmail.com> | 2015-07-15 17:24:07 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2015-07-15 17:24:30 +0300 |
commit | 80a222ce4cfc6e58be812dcbc298528bde97cb83 (patch) | |
tree | 125d9e86f7f6b21738ff3bd427cba3b6d2cb2470 /plugins/UserCountry | |
parent | 4c3a2d00fd410677227bd6014e4cacf0ce569cb3 (diff) |
Fixes #8230 Make LocationProvider:getProvider return null instead of false
Diffstat (limited to 'plugins/UserCountry')
-rw-r--r-- | plugins/UserCountry/API.php | 4 | ||||
-rwxr-xr-x | plugins/UserCountry/LocationProvider.php | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/UserCountry/API.php b/plugins/UserCountry/API.php index bd10d6f0ad..a9dbd0c414 100644 --- a/plugins/UserCountry/API.php +++ b/plugins/UserCountry/API.php @@ -180,12 +180,12 @@ class API extends \Piwik\Plugin\API { Piwik::checkUserHasSomeViewAccess(); - if ($provider === false) { + if (empty($provider)) { $provider = LocationProvider::getCurrentProviderId(); } $oProvider = LocationProvider::getProviderById($provider); - if ($oProvider === false) { + if (empty($oProvider)) { throw new Exception("Cannot find the '$provider' provider. It is either an invalid provider " . "ID or the ID of a provider that is not working."); } diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php index 01eef0f977..f12a2126d5 100755 --- a/plugins/UserCountry/LocationProvider.php +++ b/plugins/UserCountry/LocationProvider.php @@ -277,7 +277,7 @@ abstract class LocationProvider * * This function should not be called by the Tracker. * - * @return \Piwik\Plugins\UserCountry\LocationProvider + * @return \Piwik\Plugins\UserCountry\LocationProvider|null */ public static function getCurrentProvider() { @@ -307,7 +307,7 @@ abstract class LocationProvider * Returns a provider instance by ID or false if the ID is invalid or unavailable. * * @param string $providerId - * @return \Piwik\Plugins\UserCountry\LocationProvider|false + * @return \Piwik\Plugins\UserCountry\LocationProvider|null */ public static function getProviderById($providerId) { @@ -317,7 +317,7 @@ abstract class LocationProvider } } - return false; + return null; } public function getId() |