.github
1 year ago
.phan
1 year ago
src
1 year ago
tests
1 year ago
LICENSE
1 year ago
README.md
1 year ago
composer.json
1 year ago
composer.lock
1 year ago
phpcs-ruleset.xml
1 year ago
phpunit.xml
1 year ago
README.md
85 lines
| 1 | # APIMatic Core Library for PHP |
| 2 | |
| 3 | [![Version][packagist-version]][packagist-url] |
| 4 | [![Tests][test-badge]][test-url] |
| 5 | [](https://codeclimate.com/github/apimatic/core-lib-php/test_coverage](https://codeclimate.com/github/apimatic/core-lib-php/test_coverage](https://codeclimate.com/github/apimatic/core-lib-php/test_coverage) |
| 6 | [](https://codeclimate.com/github/apimatic/core-lib-php/maintainability](https://codeclimate.com/github/apimatic/core-lib-php/maintainability](https://codeclimate.com/github/apimatic/core-lib-php/maintainability) |
| 7 | [![Licence][license-badge]][license-url] |
| 8 | |
| 9 | |
| 10 | ## Introduction |
| 11 | |
| 12 | Core logic and the utilities for the Apimatic's PHP SDK. |
| 13 | |
| 14 | ## Supported PHP Versions |
| 15 | - PHP 7.2 |
| 16 | - PHP 7.4 |
| 17 | - PHP 8.0 |
| 18 | - PHP 8.1 |
| 19 | - PHP 8.2 |
| 20 | |
| 21 | ## Install the Package |
| 22 | |
| 23 | Run the following command to install the package and automatically add the dependency to your composer.json file: |
| 24 | |
| 25 | ```php |
| 26 | composer require "apimatic/core" |
| 27 | ``` |
| 28 | |
| 29 | ## Request |
| 30 | | Name | Description | |
| 31 | |-------------------------------------------------------------------------------|-----------------------------------------------------------------------| |
| 32 | | [](src/Request/Parameters/AdditionalFormParams.php`AdditionalFormParams`](src/Request/Parameters/AdditionalFormParams.php](src/Request/Parameters/AdditionalFormParams.php) | Used to add additional form params to a request | |
| 33 | | [](src/Request/Parameters/AdditionalHeaderParams.php`AdditionalHeaderParams`](src/Request/Parameters/AdditionalHeaderParams.php](src/Request/Parameters/AdditionalHeaderParams.php) | Used to add additional header params to a request | |
| 34 | | [](src/Request/Parameters/AdditionalQueryParams.php`AdditionalQueryParams`](src/Request/Parameters/AdditionalQueryParams.php](src/Request/Parameters/AdditionalQueryParams.php) | Used to add additional query params to a request | |
| 35 | | [](src/Request/Parameters/BodyParam.php`BodyParam`](src/Request/Parameters/BodyParam.php](src/Request/Parameters/BodyParam.php) | Body parameter class | |
| 36 | | [](src/Request/Parameters/FormParam.php`FormParam`](src/Request/Parameters/FormParam.php](src/Request/Parameters/FormParam.php) | Form parameter class | |
| 37 | | [](src/Request/Parameters/HeaderParam.php`HeaderParam`](src/Request/Parameters/HeaderParam.php](src/Request/Parameters/HeaderParam.php) | Header parameter class | |
| 38 | | [](src/Request/Parameters/QueryParam.php`QueryParam`](src/Request/Parameters/QueryParam.php](src/Request/Parameters/QueryParam.php) | Query parameter class | |
| 39 | | [](src/Request/Parameters/TemplateParam.php`TemplateParam`](src/Request/Parameters/TemplateParam.php](src/Request/Parameters/TemplateParam.php) | Template parameter class | |
| 40 | | [](src/Request/RequestBuilder.php`RequestBuilder`](src/Request/RequestBuilder.php](src/Request/RequestBuilder.php) | Used to instantiate a new Request object with the properties provided | |
| 41 | | [](src/Request/Request.php`Request`](src/Request/Request.php](src/Request/Request.php) | Request class for an API call | |
| 42 | |
| 43 | ## Response |
| 44 | | Name | Description | |
| 45 | |-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------| |
| 46 | | [](src/Response/Types/DeserializableType.php`DeserializableType`](src/Response/Types/DeserializableType.php](src/Response/Types/DeserializableType.php) | Type handler used to deserialize Enums and DateTime | |
| 47 | | [](src/Response/Types/ErrorType.php`ErrorType`](src/Response/Types/ErrorType.php](src/Response/Types/ErrorType.php) | Type handler used to throw exceptions from responses | |
| 48 | | [](src/Response/Types/ResponseMultiType.php`ResponseMultiType`](src/Response/Types/ResponseMultiType.php](src/Response/Types/ResponseMultiType.php) | Maps a group of types to response body | |
| 49 | | [](src/Response/Types/ResponseType.php`ResponseType`](src/Response/Types/ResponseType.php](src/Response/Types/ResponseType.php) | Maps a model to response body | |
| 50 | | [](src/Response/ResponseError.php`ResponseError`](src/Response/ResponseError.php](src/Response/ResponseError.php) | Group of error types for response | |
| 51 | | [](src/Response/ResponseHandler.php`ResponseHandler`](src/Response/ResponseHandler.php](src/Response/ResponseHandler.php) | Response handler for an API call that holds all the above response handling features | |
| 52 | | [](src/Response/Context.php`Context`](src/Response/Context.php](src/Response/Context.php) | Holds the current context i.e. the current request, response and other needed details | |
| 53 | |
| 54 | ## Logger |
| 55 | | Name | Description | |
| 56 | |---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------| |
| 57 | | [](src/Logger/ApiLogger.php`ApiLogger`](src/Logger/ApiLogger.php](src/Logger/ApiLogger.php) | Provides implementation for logging API requests and responses | |
| 58 | | [](src/Logger/NullApiLogger.php`NullApiLogger`](src/Logger/NullApiLogger.php](src/Logger/NullApiLogger.php) | Provides the default implementation for ApiLogger when no logging configuration is provided | |
| 59 | | [](src/Logger/ConsoleLogger.php`ConsoleLogger`](src/Logger/ConsoleLogger.php](src/Logger/ConsoleLogger.php) | A LoggerInterface implementation that log messages on console | |
| 60 | | [](src/Logger/LoggerConstants.php`LoggerConstants`](src/Logger/LoggerConstants.php](src/Logger/LoggerConstants.php) | Holds constants like NON_SENSITIVE_HEADERS, etc. | |
| 61 | | [](src/Logger/Configuration/BaseHttpLoggingConfiguration.php`BaseHttpLoggingConfiguration`](src/Logger/Configuration/BaseHttpLoggingConfiguration.php](src/Logger/Configuration/BaseHttpLoggingConfiguration.php) | Common configurations shared by request and response logging configurations | |
| 62 | | [](src/Logger/Configuration/LoggingConfiguration.php`LoggingConfiguration`](src/Logger/Configuration/LoggingConfiguration.php](src/Logger/Configuration/LoggingConfiguration.php) | Provides client's logging configurations | |
| 63 | | [](src/Logger/Configuration/RequestConfiguration.php`RequestConfiguration`](src/Logger/Configuration/RequestConfiguration.php](src/Logger/Configuration/RequestConfiguration.php) | Provides request's logging configurations | |
| 64 | | [](src/Logger/Configuration/ResponseConfiguration.php`ResponseConfiguration`](src/Logger/Configuration/ResponseConfiguration.php](src/Logger/Configuration/ResponseConfiguration.php) | Provides response's logging configurations | |
| 65 | |
| 66 | ## TestCase |
| 67 | | Name | Description | |
| 68 | |--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------| |
| 69 | | [](src/TestCase/BodyMatchers/KeysAndValuesBodyMatcher.php`KeysAndValuesBodyMatcher`](src/TestCase/BodyMatchers/KeysAndValuesBodyMatcher.php](src/TestCase/BodyMatchers/KeysAndValuesBodyMatcher.php) | Matches actual and expected body, considering both the keys and values | |
| 70 | | [](src/TestCase/BodyMatchers/KeysBodyMatcher.php`KeysBodyMatcher`](src/TestCase/BodyMatchers/KeysBodyMatcher.php](src/TestCase/BodyMatchers/KeysBodyMatcher.php) | Matches actual and expected body, considering just the keys | |
| 71 | | [](src/TestCase/BodyMatchers/NativeBodyMatcher.php`NativeBodyMatcher`](src/TestCase/BodyMatchers/NativeBodyMatcher.php](src/TestCase/BodyMatchers/NativeBodyMatcher.php) | A body matcher for native values like string, int etc | |
| 72 | | [](src/TestCase/BodyMatchers/RawBodyMatcher.php`RawBodyMatcher`](src/TestCase/BodyMatchers/RawBodyMatcher.php](src/TestCase/BodyMatchers/RawBodyMatcher.php) | Exactly matches the body received to expected body | |
| 73 | | [](src/TestCase/HeadersMatcher.php`HeadersMatcher`](src/TestCase/HeadersMatcher.php](src/TestCase/HeadersMatcher.php) | Matches the headers received and the headers expected | |
| 74 | | [](src/TestCase/StatusCodeMatcher.php`StatusCodeMatcher`](src/TestCase/StatusCodeMatcher.php](src/TestCase/StatusCodeMatcher.php) | Matches the HTTP status codes received to the expected ones | |
| 75 | | [](core-lib-php/src/TestCase/CoreTestCase.php`CoreTestCase`](core-lib-php/src/TestCase/CoreTestCase.php](core-lib-php/src/TestCase/CoreTestCase.php) | Main class for a test case that performs assertions w/ all the above matchers | |
| 76 | |
| 77 | |
| 78 | [packagist-url]: https://packagist.org/packages/apimatic/core |
| 79 | [packagist-version]: https://img.shields.io/packagist/v/apimatic/core.svg?style=flat |
| 80 | [packagist-downloads]: https://img.shields.io/packagist/dm/apimatic/core.svg?style=flat |
| 81 | [test-badge]: https://github.com/apimatic/core-lib-php/actions/workflows/test.yml/badge.svg |
| 82 | [test-url]: https://github.com/apimatic/core-lib-php/actions/workflows/test.yml |
| 83 | [license-badge]: https://img.shields.io/badge/licence-MIT-blue |
| 84 | [license-url]: LICENSE |
| 85 |