yproximite / yprox-api-client-bundle
Integration of yProx API client library for Symfony
Installs: 3 820
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 11
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.2
- symfony/framework-bundle: ^3.4 || ^4.0 || ^5.0
- yproximite/yprox-api-client: ^0.11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpspec/phpspec: ^6.0
- phpstan/phpstan: ^0.12.53
- phpstan/phpstan-phpunit: ^0.12.16
- phpstan/phpstan-strict-rules: ^0.12.5
- symfony/phpunit-bridge: ^3.4 || ^4.0 || ^5.0
This package is auto-updated.
Last update: 2024-11-29 05:34:06 UTC
README
Installation
Require
yproximite/yprox-api-client-bundle
to your composer.json
file:
$ composer require yproximite/yprox-api-client-bundle
Register the bundle in app/AppKernel.php
:
// app/AppKernel.php public function registerBundles() { return [ // ... new Yproximite\Bundle\YproxApiClientBundle\YproxApiClientBundle(), ]; }
Configuration
Here is the configuration reference:
# app/config/config.yml yprox_api_client: # Identifier of the service that represents "Http\Client\HttpClient" http_client: httplug.client.guzzle6 clients: # Simple example default: api_key: xxxxx # Advanced example custom: api_key: yyyyy base_url: http://api.host.com
Usage
// yprox_api_client.service_aggregator.<client_name_from_config> $api = $this->get('yprox_api_client.service_aggregator.default'); $message = new ArticleListMessage(); $message->setSiteId(1); // Yproximite\Api\Model\Article\Article[] $articles = $api->article()->getArticles($message);