chadicus / marvel-api-client
PHP Client for the Marvel API
v3.0.1
2018-01-28 16:35 UTC
Requires
- php: ^7.0
- chadicus/psr-cache-helper: ^0.2.1
- chadicus/spl-exceptions: ^1.0
- chadicus/spl-types: ^1.0
- dominionenterprises/filter: 2.1
- dominionenterprises/util: ^2.0
- guzzlehttp/guzzle: ^6.2
- psr/simple-cache: ^1.0
Requires (Dev)
- chadicus/coding-standard: ^1.3
- chadicus/test-helpers: ^1.0
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ^6.0
Suggests
- chadicus/psr-cache-mongodb: Adds response caching with mongodb
This package is auto-updated.
Last update: 2024-10-19 21:52:19 UTC
README
A PHP client for use with the Marvel API.
Requirements
The Marvel API Client requires PHP 7.0 (or later).
Composer
To add the library as a local, per-project dependency use Composer! Simply add a dependency on chadicus/marvel-api-client
to your project's composer.json
file such as:
composer require chadicus/marvel-api-client
Examples
Examples of use can be found here
Basic Usage
<?php require_once __DIR__ . '/vendor/autoload.php'; use Chadicus\Marvel\Api\Client; $publicApiKey = 'YOUR PUBLIC API KEY'; $privateApiKey = 'YOUR PRIVATE API KEY'; $client = new Client($privateApiKey, $publicApiKey); $dataWrapper = $client->get('characters', 1009351); //Text to display for attribution requirements $attributionText = $dataWrapper->getAttributionText(); $character = $dataWrapper->getData()->getResults()[0]; echo "{$character->getName()}\n"; echo "{$character->getDescription()}\n"; foreach ($character->getEvents()->getItems() as $event) { echo "\t{$event->getName()}\n"; }
Community
Contact
Developers may be contacted at:
Project Build
With a checkout of the code get Composer in your PATH and run:
composer install ./vendor/bin/phpunit
With Great Power Comes Great Responsibility.
When using the marvel-api-client
you must follow Marvel's Rules of Attribution