-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from maxmind/greg/release
Release 0.10.0
- Loading branch information
Showing
13 changed files
with
105 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 |
---|---|---|
|
@@ -3,5 +3,4 @@ parameters: | |
paths: | ||
- src | ||
- tests | ||
checkMissingIterableValueType: false | ||
|
This file contains 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 |
---|---|---|
@@ -1,20 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="./tests/bootstrap.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="minFraud Test Suite"> | ||
<directory suffix="Test.php">./tests/MaxMind/Test/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src/MaxMind/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
</logging> | ||
|
||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">./src/MaxMind/</directory> | ||
</include> | ||
<report> | ||
<clover outputFile="build/logs/clover.xml"/> | ||
</report> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory suffix="Test.php">./tests/MaxMind/Test/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<logging/> | ||
</phpunit> |
This file contains 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 |
---|---|---|
|
@@ -77,17 +77,17 @@ class Client | |
private $accountId; | ||
|
||
/** | ||
* @param int $accountId your MaxMind account ID | ||
* @param string $licenseKey your MaxMind license key | ||
* @param array $options an array of options. Possible keys: | ||
* * `host` - The host to use when connecting to the web service. | ||
* * `useHttps` - A boolean flag for sending the request via https.(True by default) | ||
* * `userAgent` - The prefix of the User-Agent to use in the request. | ||
* * `caBundle` - The bundle of CA root certificates to use in the request. | ||
* * `connectTimeout` - The connect timeout to use for the request. | ||
* * `timeout` - The timeout to use for the request. | ||
* * `proxy` - The HTTP proxy to use. May include a schema, port, | ||
* username, and password, e.g., `http://username:[email protected]:10`. | ||
* @param int $accountId your MaxMind account ID | ||
* @param string $licenseKey your MaxMind license key | ||
* @param array<string, mixed> $options an array of options. Possible keys: | ||
* * `host` - The host to use when connecting to the web service. | ||
* * `useHttps` - Set to false to disable HTTPS. | ||
* * `userAgent` - The prefix of the User-Agent to use in the request. | ||
* * `caBundle` - The bundle of CA root certificates to use in the request. | ||
* * `connectTimeout` - The connect timeout to use for the request. | ||
* * `timeout` - The timeout to use for the request. | ||
* * `proxy` - The HTTP proxy to use. May include a schema, port, | ||
* username, and password, e.g., `http://username:[email protected]:10`. | ||
*/ | ||
public function __construct( | ||
int $accountId, | ||
|
@@ -127,9 +127,9 @@ public function __construct( | |
} | ||
|
||
/** | ||
* @param string $service name of the service querying | ||
* @param string $path the URI path to use | ||
* @param array $input the data to be posted as JSON | ||
* @param string $service name of the service querying | ||
* @param string $path the URI path to use | ||
* @param array<mixed> $input the data to be posted as JSON | ||
* | ||
* @throws InvalidInputException when the request has missing or invalid | ||
* data | ||
|
@@ -142,7 +142,7 @@ public function __construct( | |
* @throws WebServiceException when some other error occurs. This also | ||
* serves as the base class for the above exceptions. | ||
* | ||
* @return array|null The decoded content of a successful response | ||
* @return array<mixed>|null The decoded content of a successful response | ||
*/ | ||
public function post(string $service, string $path, array $input): ?array | ||
{ | ||
|
@@ -170,6 +170,9 @@ public function post(string $service, string $path, array $input): ?array | |
); | ||
} | ||
|
||
/** | ||
* @return array<mixed>|null | ||
*/ | ||
public function get(string $service, string $path): ?array | ||
{ | ||
$request = $this->createRequest( | ||
|
@@ -195,6 +198,9 @@ private function userAgent(): string | |
' curl/' . $curlVersion['version']; | ||
} | ||
|
||
/** | ||
* @param array<string> $headers | ||
*/ | ||
private function createRequest(string $path, array $headers = []): Http\Request | ||
{ | ||
array_push( | ||
|
@@ -233,7 +239,7 @@ private function createRequest(string $path, array $headers = []): Http\Request | |
* @throws WebServiceException when some other error occurs. This also | ||
* serves as the base class for the above exceptions | ||
* | ||
* @return array|null The decoded content of a successful response | ||
* @return array<mixed>|null The decoded content of a successful response | ||
*/ | ||
private function handleResponse( | ||
int $statusCode, | ||
|
@@ -463,7 +469,7 @@ private function handleUnexpectedStatus(int $statusCode, string $service, string | |
* included, or is expected and included | ||
* but cannot be decoded as JSON | ||
* | ||
* @return array|null the decoded request body | ||
* @return array<mixed>|null the decoded request body | ||
*/ | ||
private function handleSuccess(int $statusCode, ?string $body, string $service): ?array | ||
{ | ||
|
This file contains 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 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 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 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 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