Tidying and doc fixes
This commit is contained in:
@@ -14,7 +14,7 @@ use MaxMind\Db\Reader as DbReader;
|
||||
* client, although we may offer the ability to specify additional databases
|
||||
* to replicate these web services in the future (e.g., the ISP/Org database).
|
||||
*
|
||||
* **Usage**
|
||||
* **Usage**
|
||||
*
|
||||
* The basic API for this class is the same for every database. First, you
|
||||
* create a reader object, specifying a file name. You then call the method
|
||||
@@ -44,7 +44,7 @@ class Reader implements ProviderInterface
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $filename The path to the GeoIP2 database file.
|
||||
* @param array $locales List of locale codes to use in name property
|
||||
* @param array $locales List of locale codes to use in name property
|
||||
* from most preferred to least preferred.
|
||||
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
||||
* is corrupt or invalid
|
||||
|
||||
@@ -17,7 +17,7 @@ class HttpException extends GeoIp2Exception
|
||||
$message,
|
||||
$httpStatus,
|
||||
$uri,
|
||||
Exception $previous = null
|
||||
\Exception $previous = null
|
||||
) {
|
||||
$this->uri = $uri;
|
||||
parent::__construct($message, $httpStatus, $previous);
|
||||
|
||||
@@ -18,7 +18,7 @@ class InvalidRequestException extends HttpException
|
||||
$error,
|
||||
$httpStatus,
|
||||
$uri,
|
||||
Exception $previous = null
|
||||
\Exception $previous = null
|
||||
) {
|
||||
$this->error = $error;
|
||||
parent::__construct($message, $httpStatus, $uri, $previous);
|
||||
|
||||
@@ -113,8 +113,8 @@ class City extends Country
|
||||
|
||||
private function mostSpecificSubdivision()
|
||||
{
|
||||
return empty($this->subdivisions)?
|
||||
new \GeoIp2\Record\Subdivision(array(), $this->locales):
|
||||
return empty($this->subdivisions) ?
|
||||
new \GeoIp2\Record\Subdivision(array(), $this->locales) :
|
||||
end($this->subdivisions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class Country
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
public function __get ($attr)
|
||||
public function __get($attr)
|
||||
{
|
||||
if ($attr != "instance" && isset($this->$attr)) {
|
||||
return $this->$attr;
|
||||
|
||||
@@ -7,28 +7,28 @@ interface ProviderInterface
|
||||
/**
|
||||
* @param ipAddress
|
||||
* IPv4 or IPv6 address to lookup.
|
||||
* @return A Country model for the requested IP address.
|
||||
* @return \GeoIp2\Model\Country A Country model for the requested IP address.
|
||||
*/
|
||||
public function country($ipAddress);
|
||||
|
||||
/**
|
||||
* @param ipAddress
|
||||
* IPv4 or IPv6 address to lookup.
|
||||
* @return A City model for the requested IP address.
|
||||
* @return \GeoIp2\Model\City A City model for the requested IP address.
|
||||
*/
|
||||
public function city($ipAddress);
|
||||
|
||||
/**
|
||||
* @param ipAddress
|
||||
* IPv4 or IPv6 address to lookup.
|
||||
* @return A CityIspOrg model for the requested IP address.
|
||||
* @return \GeoIp2\Model\CityIspOrg A CityIspOrg model for the requested IP address.
|
||||
*/
|
||||
public function cityIspOrg($ipAddress);
|
||||
|
||||
/**
|
||||
* @param ipAddress
|
||||
* IPv4 or IPv6 address to lookup.
|
||||
* @return An Omni model for the requested IP address.
|
||||
* @return \GeoIp2\Model\Omni An Omni model for the requested IP address.
|
||||
*/
|
||||
public function omni($ipAddress);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace GeoIp2\Record;
|
||||
* @property array $names An array map where the keys are locale codes and
|
||||
* the values are names. This attribute is returned by all end points except
|
||||
* Country.
|
||||
*/
|
||||
*/
|
||||
class Subdivision extends AbstractPlaceRecord
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
namespace GeoIp2\WebService;
|
||||
|
||||
use GeoIp2\Exception\GeoIp2Exception;
|
||||
use GeoIp2\Exception\HttpException;
|
||||
use GeoIp2\Exception\AddressNotFoundException;
|
||||
use GeoIp2\Exception\AuthenticationException;
|
||||
use GeoIp2\Exception\GeoIp2Exception;
|
||||
use GeoIp2\Exception\HttpException;
|
||||
use GeoIp2\Exception\InvalidRequestException;
|
||||
use GeoIp2\Exception\OutOfQueriesException;
|
||||
use GeoIp2\ProviderInterface;
|
||||
use Guzzle\Http\Client as GuzzleClient;
|
||||
use Guzzle\Common\Exception\RuntimeException;
|
||||
use Guzzle\Http\Client as GuzzleClient;
|
||||
use Guzzle\Http\Exception\ClientErrorResponseException;
|
||||
use Guzzle\Http\Exception\ServerErrorResponseException;
|
||||
|
||||
@@ -56,9 +56,9 @@ class Client implements ProviderInterface
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param int $userId Your MaxMind user ID
|
||||
* @param int $userId Your MaxMind user ID
|
||||
* @param string $licenseKey Your MaxMind license key
|
||||
* @param array $locales List of locale codes to use in name property
|
||||
* @param array $locales List of locale codes to use in name property
|
||||
* from most preferred to least preferred.
|
||||
* @param string $host Optional host parameter
|
||||
* @param object $guzzleClient Optional Guzzle client to use (to facilitate
|
||||
@@ -258,8 +258,6 @@ class Client implements ProviderInterface
|
||||
{
|
||||
$status = $response->getStatusCode();
|
||||
|
||||
$body = array();
|
||||
|
||||
if ($response->getContentLength() > 0) {
|
||||
if (strstr($response->getContentType(), 'json')) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user