All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added
rector/rectordev-dependency - Added issue templates, and a pull request template.
- Added new docs/files:
- backward-compatibility.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- Changed locally called
private staticmethods to non static methods. - Changed test classes to
final - Merged workflows into
.github/workflows/continuous-integration.yml - Updated
CHANGELOG.mdto be compatibile with the Keep a Changelog format. - Updated
README.md
- Removed the following workflows from
.github/workflowsanalysis.ymlpsalm.ymltests.yml
3.0.1 - 2024-03-13
vimeo/psalmadded into dev-dependencies and workflowTestDoxattribute used for all unit tests instead of '@testCase' (work in progress)
- Updates throughout to fix psalm-reported issues.
- Initially level 2, now should be valid on Psalm level 1.
- Changed the following private methods of the
Apiclass to static methods:buildCacheHandlervalidateAndDecodeResponsegetUrl
- Modifed
Numverify\PhoneNumber\PhoneNumberInterfaceto extendJsonSerializable,Stringable - Refactored
validateAndDecodeResponseandbuildCacheHandler
- Removed unnecessary constructor and properties from
Numverify\Exception\NumverifyApiResponseException - Removed '@testCase' annotation from all unit tests.
- At the moment, the cache middleware for Guzzle is using files. For 3.1, perhaps I could look into supporting Redis, Memcached, etc.
3.0.0 - 2024-03-10
Forked from markrogoyski/numverify-api-client-php v2.2.0.
- Guzzle cache support via
kevinrob/guzzle-cache-middlewareandsymfony/cache.- New function
Api::buildCacheHandlerwhich will add the cache middleware to the handler stack if $options['cachePath'] is passed to Api's constructor.
- New function
- Imports for all used functions, constants, and class names.
- dev-dependencies for PHP-CS-Fixer and PHPStan (w/extensions for phpunit, strict rules)
- New workflow for static analysis:
.github/workflows/analysis.yml - CHANGELOG.md, SECURITY.md
- Updated composer.json
- Bumped minimum PHP version to 8.2
- Autoloading should follow PSR-4
- Updated PHPUnit to 11.0+
- Added
strict_typesdeclaration and PHPDoc header to all files. Api::__constructhas a new$optionsparameter, which is optional, that can pass options to Guzzle Client.NumverifyApiFailureExceptionis wrapped around\GuzzleHttp\Exception\ServerExceptionApi::validateResponse()changed toApi::validateAndDecodeResponse().- Old signature:
private function validateResponse(\Psr\Http\Message\ResponseInterface $response): void - New signature:
private function validateAndDecodeResponse(ResponseInterface $response, bool $asArray = false): stdClass | array - It now checks
getStatusCodeand the response body forsuccess. Returns the decoded jSON.
- Old signature:
- Updated unit tests to use Guzzle's
MockHandler.- Fixed tests and PHPUnit method calls/attributes/etc. to be in line with PHPUnit 11+
- Cleaned up code and refactored to use newer PHP 8 features / conventions.
- Should now adhere to PER and PSR-12 as well.
- Now passes PHPStan using level 9 w/strict rules.
- Added parameter and return type hints throughout.
- Any class implementing
JsonSerializablenow also implementsStringable. - Updated README.md
.github/workflows/test_develop_and_master.yml, replaced with.github/workflows/tests.yml.github/workflows/test_other_branches.yml, replaced with.github/workflows/tests.yml.github/workflows/test_pull_request.yml, replaced with.github/workflows/tests.ymltests/bootstrap.php,tests/phpunit.xml,tests/coding_standard.xml
- Documentation improvements.