2017 © Pedro Peláez
 

library marvel-api-client

PHP Client for the Marvel API

image

chadicus/marvel-api-client

PHP Client for the Marvel API

  • Sunday, January 28, 2018
  • by chadicus
  • Repository
  • 3 Watchers
  • 16 Stars
  • 311 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 3 Open issues
  • 13 Versions
  • 1 % Grown

The README.md

Marvel API Client

Build Status Code Quality Code Coverage, (*1)

Latest Stable Version Latest Unstable Version License, (*2)

Total Downloads Daily Downloads Monthly Downloads, (*3)

A PHP client for use with the Marvel API., (*4)

Requirements

The Marvel API Client requires PHP 7.0 (or later)., (*5)

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:, (*6)

composer require chadicus/marvel-api-client

Examples

Examples of use can be found here, (*7)

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

Gitter, (*8)

Contact

Developers may be contacted at: * Pull Requests * Issues, (*9)

Project Build

With a checkout of the code get Composer in your PATH and run:, (*10)

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, (*11)

The Versions

05/08 2015