Skip to content

Commit

Permalink
Merge pull request #35 from chadicus/v3.x
Browse files Browse the repository at this point in the history
Version 3
  • Loading branch information
chadicus authored Jan 7, 2018
2 parents ed10efc + beae439 commit 02e88d2
Show file tree
Hide file tree
Showing 89 changed files with 3,491 additions and 3,093 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
service_name: travis-ci
src_dir: .
coverage_clover: clover.xml
json_path: coveralls-upload.json
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Enforce Unix newlines
* text=lf

# Exclude unused files
# see: https://redd.it/2jzp6k
/tests export-ignore
/examples export-ignore
/.github export-ignore
/*.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/*.xml export-ignore
14 changes: 7 additions & 7 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ filter:
excluded_paths:
- 'vendor/*'
- 'tests/*'
- 'examples/*'
before_commands:
- 'composer install --prefer-source'
checks:
php:
custom_coding_standard:
git_repository: 'https://github.com/chadicus/coding-standard'
git_version: '971fac1625463a72df0034fbfdd263561f2ccb4f'
ruleset_path: 'Chadicus/ruleset.xml'
build:
tests:
override:
- phpcs-run --standard=./vendor/chadicus/coding-standard/Chadicus/ruleset.xml src
tools:
php_analyzer: true
php_mess_detector: true
Expand All @@ -18,10 +17,11 @@ tools:
excluded_dirs:
- vendor
- tests
- examples
php_pdepend: true
php_sim: true
build_failure_conditions:
- 'elements.rating(<= C).new.exists'
- 'elements.rating(<= B).new.exists'
- 'issues.label("coding-style").new.exists'
- 'issues.severity(>= MAJOR).new.exists'
- 'project.metric("scrutinizer.quality", < 6)'
17 changes: 1 addition & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
language: php
php:
- 5.6
- 7.0
- 7.1
env:
- EXT_VERSION=1.1 DB_PACKAGE=mongodb-10gen
- EXT_VERSION=1.1 DB_PACKAGE=mongodb-org
before_install:
- "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10"
- "echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list"
- "sudo apt-get update"
- "sudo apt-get install ${DB_PACKAGE}"
- 7.2
before_script:
- composer self-update
- yes '' | pecl install -f mongodb-${EXT_VERSION}
# wait for mongo, start is only needed for 2.4 package, see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax.
- sudo service mongodb start; bash -c 'while ! exec 6<>/dev/tcp/localhost/27017; do echo "$(date) - still trying to connect to mongo"; sleep 1; done'
- composer install
script: ./vendor/bin/phpunit --coverage-clover clover.xml
after_success: ./vendor/bin/coveralls -v
matrix:
fast_finish: true
allow_failures:
- php: 7.1
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Marvel API Client
[![Build Status](https://travis-ci.org/chadicus/marvel-api-client.svg?branch=master)](https://travis-ci.org/chadicus/marvel-api-client)
[![Code Quality](https://scrutinizer-ci.com/g/chadicus/marvel-api-client/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/chadicus/marvel-api-client/?branch=master)
[![Code Coverage](https://coveralls.io/repos/github/chadicus/marvel-api-client/badge.svg?branch=master)](https://coveralls.io/github/chadicus/marvel-api-client?branch=master)
[![Build Status](https://travis-ci.org/chadicus/marvel-api-client.svg?branch=v3.x)](https://travis-ci.org/chadicus/marvel-api-client)
[![Code Quality](https://scrutinizer-ci.com/g/chadicus/marvel-api-client/badges/quality-score.png?b=v3.x)](https://scrutinizer-ci.com/g/chadicus/marvel-api-client/?branch=v3.x)
[![Code Coverage](https://coveralls.io/repos/github/chadicus/marvel-api-client/badge.svg?branch=v3.x)](https://coveralls.io/github/chadicus/marvel-api-client?branch=v3.x)

[![Latest Stable Version](https://poser.pugx.org/chadicus/marvel-api-client/v/stable)](https://packagist.org/packages/chadicus/marvel-api-client)
[![Latest Unstable Version](https://poser.pugx.org/chadicus/marvel-api-client/v/unstable)](https://packagist.org/packages/chadicus/marvel-api-client)
Expand All @@ -15,20 +15,16 @@ A PHP client for use with the [Marvel API](http://developer.marvel.com/docs).

## Requirements

The Marvel API Client requires PHP 5.6 (or later).
The Marvel API Client requires PHP 7.0 (or later).

## Composer
To add the library as a local, per-project dependency use [Composer](http://getcomposer.org)! Simply add a dependency on `chadicus/marvel-api-client` to your project's `composer.json` file such as:

```json
{
"require": {
"chadicus/marvel-api-client": "^2.0"
}
}
```sh
composer require chadicus/marvel-api-client
```
## Examples
Examples of use can be found [here](https://github.com/chadicus/marvel-api-client/tree/master/examples).
Examples of use can be found [here](/examples)

### Basic Usage

Expand All @@ -39,17 +35,17 @@ require_once __DIR__ . '/vendor/autoload.php';

use Chadicus\Marvel\Api\Client;

$publicApiKey = getenv('PUBLIC_KEY');
$privateApiKey = getenv('PRIVATE_KEY');
$publicApiKey = 'YOUR PUBLIC API KEY';
$privateApiKey = 'YOUR PRIVATE API KEY';

$client = new Client($privateApiKey, $publicApiKey);

$response = $client->get('characters', 1009351);
$dataWrapper = $client->get('characters', 1009351);

//Text to display for attribution requirements
$attributionText = $response->getDataWrapper()->getAttributionText();
$attributionText = $dataWrapper->getAttributionText();

$character = $response->getDataWrapper()->getData()->getResults()[0];
$character = $dataWrapper->getData()->getResults()[0];

echo "{$character->getName()}\n";
echo "{$character->getDescription()}\n";
Expand All @@ -60,13 +56,15 @@ foreach ($character->getEvents()->getItems() as $event) {

```

## Community
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/marvel-api-client/Lobby#)

## Contact
Developers may be contacted at:

* [Pull Requests](https://github.com/chadicus/marvel-api-client/pulls)
* [Issues](https://github.com/chadicus/marvel-api-client/issues)

##Project Build
## Project Build
With a checkout of the code get [Composer](http://getcomposer.org) in your PATH and run:

```sh
Expand Down
22 changes: 12 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
],
"license": "MIT",
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.0",
"dominionenterprises/util" : "^2.0",
"dominionenterprises/filter" : "^2.0",
"dominionenterprises/filter" : "2.1",
"chadicus/spl-types": "^1.0",
"chadicus/spl-exceptions": "^1.0"
"chadicus/spl-exceptions": "^1.0",
"guzzlehttp/guzzle": "^6.2",
"psr/simple-cache": "^1.0",
"chadicus/psr-cache-helper": "^0.2.1"
},
"suggest": {
"chadicus/psr-cache-mongodb": "Adds response caching with mongodb"
},
"require-dev": {
"phpunit/phpunit": "^5.5",
"satooshi/php-coveralls": "^1.0",
"chadicus/coding-standard": "^1.1",
"phpunit/phpunit": "^6.0",
"chadicus/coding-standard": "^1.3",
"chadicus/test-helpers": "^1.0",
"mongodb/mongodb": "^1.0"
},
"suggests" : {
"mongodb/mongodb": "Needed to enable mongo caching"
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
"psr-4": { "Chadicus\\Marvel\\Api\\": ["src", "tests"] }
Expand Down
Loading

0 comments on commit 02e88d2

Please # to comment.