Skip to content

Commit

Permalink
README and Tests update
Browse files Browse the repository at this point in the history
  • Loading branch information
dolejska-daniel committed Jan 24, 2021
1 parent 5236419 commit 0a75a28
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 33 deletions.
62 changes: 29 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RiotAPI PHP7 wrapper
# RiotAPI PHP wrapper for DataDragon
> Version v1.0.0
[![Build Status](https://img.shields.io/travis/dolejska-daniel/riot-api-datadragon/master)](https://travis-ci.com/dolejska-daniel/riot-api-datadragon)
Expand All @@ -15,22 +15,18 @@


# [Introduction](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/Home#introduction)
Welcome to the RiotAPI PHP7 library repo!
Welcome to the DataDragon PHP library repo!
The goal of this library is to create easy-to-use library for anyone who might need one.
This is fully object oriented API wrapper for League of Legends' API.
A small DataDragon API wrapper is also included.

Here are some handy features:

- **[Rate limit caching](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/LeagueAPI:-Rate-limiting)** and limit exceeding prevention - fully automatic.
- **[Call caching](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/LeagueAPI:-Call-caching)** - enables the library to re-use already fetched data within given timespan - saves time and key's rate limit.
- **[StaticData endpoints](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/LeagueAPI:-StaticData-endpoints)** - you can work with StaticData endpoints as if they were never deprecated.
- **[StaticData linking](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/LeagueAPI:-StaticData-linking)** - library can automatically link related StaticData right into the returned object.
- **[Custom callbacks](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/LeagueAPI:-Callback-functions)** - you can set custom function which will be called before or after the request is processed.
- **[Object extensions](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/LeagueAPI:-Extensions)** - you can implement your own methods to the fetched API objects and enable yourself to use them later to ease of your work.
- **[CLI supported](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/LeagueAPI:-CLI-support)** - usage of this library in console is extremely easy.
- **Interim mode** support - you are going to be able to use the library the same way whether your key is in `interim mode` or not (meaning you won't need to change anything when you jump to production).
- **Objects everywhere** - API calls return data in special objects, this allows modern IDEs to hint existing properties and methods.
- **Profile icon** URL and HTML embed generating
- **Champion splash** image URL and HTML embed generating
- **Champion loading** image URL and HTML embed generating
- **Champion icon** URL and HTML embed generating
- **Sprite image** URL and HTML embed generating
- **Spell**, **passive**, **item** and **summoner spell icon** URL and HTML embed generating
- **Runes reforged icon** URL and HTML embed generating
- **Static resource** (champions, spells, items, runes, ...) loading and processing

Please, refer mainly to the [wiki pages](https://github.com/dolejska-daniel/riot-api-datadragon/wiki).
This file contains only general introduction to library features.
Expand All @@ -56,14 +52,14 @@ echo DataDragonAPI::getChampionLoading('Orianna', 7);

**Output**:
```html
<img alt="Orianna" class="dd-icon dd-loading" src="http://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_0.jpg">
<img alt="Orianna" class="dd-icon dd-loading" src="http://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_7.jpg">
<img alt="Orianna" class="dd-icon dd-loading" src="https://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_0.jpg">
<img alt="Orianna" class="dd-icon dd-loading" src="https://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_7.jpg">
```

**Render**:

![Orianna](http://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_0.jpg)
![Dark Star Orianna](http://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_7.jpg)
![Orianna](https://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_0.jpg)
![Dark Star Orianna](https://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_7.jpg)


...a bit of nostalgia?
Expand All @@ -78,16 +74,16 @@ echo DataDragonAPI::getItemIcon(3138);

**Output**:
```html
<img alt="3132" class="dd-icon dd-item" src="http://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3132.png">
<img alt="3126" class="dd-icon dd-item" src="http://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3126.png">
<img alt="3138" class="dd-icon dd-item" src="http://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3138.png">
<img alt="3132" class="dd-icon dd-item" src="https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3132.png">
<img alt="3126" class="dd-icon dd-item" src="https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3126.png">
<img alt="3138" class="dd-icon dd-item" src="https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3138.png">
```

**Render**:

![Heart of Gold](http://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3132.png)
![Madred's Bloodrazor](http://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3126.png)
![Leviathan](http://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3138.png)
![Heart of Gold](https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3132.png)
![Madred's Bloodrazor](https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3126.png)
![Leviathan](https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3138.png)


...or to display icon of champion and its spells based on its object from API?
Expand All @@ -107,19 +103,19 @@ foreach($orianna->spells as $spell)
```html
<img alt="Orianna" class="dd-icon dd-icon-champ" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/champion/Orianna.png">

<img alt="OrianaIzunaCommand" class="dd-icon dd-spell" src="http://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaIzunaCommand.png">
<img alt="OrianaDissonanceCommand" class="dd-icon dd-spell" src="http://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDissonanceCommand.png">
<img alt="OrianaRedactCommand" class="dd-icon dd-spell" src="http://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaRedactCommand.png">
<img alt="OrianaDetonateCommand" class="dd-icon dd-spell" src="http://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDetonateCommand.png">
<img alt="OrianaIzunaCommand" class="dd-icon dd-spell" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaIzunaCommand.png">
<img alt="OrianaDissonanceCommand" class="dd-icon dd-spell" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDissonanceCommand.png">
<img alt="OrianaRedactCommand" class="dd-icon dd-spell" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaRedactCommand.png">
<img alt="OrianaDetonateCommand" class="dd-icon dd-spell" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDetonateCommand.png">
```

**Render**:

![Orianna](https://ddragon.leagueoflegends.com/cdn/8.24.1/img/champion/Orianna.png)
![OrianaIzunaCommand](http://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaIzunaCommand.png)
![OrianaDissonanceCommand](http://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDissonanceCommand.png)
![OrianaRedactCommand](http://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaRedactCommand.png)
![OrianaDetonateCommand](http://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDetonateCommand.png)
![OrianaIzunaCommand](https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaIzunaCommand.png)
![OrianaDissonanceCommand](https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDissonanceCommand.png)
![OrianaRedactCommand](https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaRedactCommand.png)
![OrianaDetonateCommand](https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDetonateCommand.png)

For more, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api-datadragon/wiki/DataDragonAPI:-How-to-begin).
More usage examples for DataDragonAPI can be found [here](https://github.com/dolejska-daniel/riot-api/blob/master/examples/DataDragonAPI/README.md).
Expand All @@ -130,7 +126,7 @@ More usage examples for DataDragonAPI can be found [here](https://github.com/dol
| Library Description | Latest Version | Stable Version |
| --------------------------------------------------------------------------------- | -------------- | -------------- |
| [All APIs](https://github.com/dolejska-daniel/riot-api) (metapackage) | ![GitHub Latest Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api?include_prereleases) | ![GitHub Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api) ![PHP Version](https://img.shields.io/packagist/php-v/dolejska-daniel/riot-api) |
| [DataDragon API](https://github.com/dolejska-daniel/riot-api-datadragon) | ![GitHub Latest Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-datadragon?include_prereleases) | ![GitHub Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-datadragon) ![PHP Version](https://img.shields.io/packagist/php-v/dolejska-daniel/riot-api-datadragon) |
| [League of Legends API](https://github.com/dolejska-daniel/riot-api-league) | ![GitHub Latest Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-league?include_prereleases) | ![GitHub Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-league) ![PHP Version](https://img.shields.io/packagist/php-v/dolejska-daniel/riot-api-league)
| [Teamfight Tactics API](https://github.com/dolejska-daniel/riot-api-tft) | ![GitHub Latest Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-tft?include_prereleases) | ![GitHub Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-tft) ![PHP Version](https://img.shields.io/packagist/php-v/dolejska-daniel/riot-api-tft) |
| [Legends of Runeterra API](https://github.com/dolejska-daniel/riot-api-runeterra) | ![GitHub Latest Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-runeterra?include_prereleases) | ![GitHub Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-runeterra) ![PHP Version](https://img.shields.io/packagist/php-v/dolejska-daniel/riot-api-runeterra) |
| [Valorant API](https://github.com/dolejska-daniel/riot-api-valorant) | ![GitHub Latest Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-valorant?include_prereleases) | ![GitHub Release](https://img.shields.io/github/v/release/dolejska-daniel/riot-api-valorant) ![PHP Version](https://img.shields.io/packagist/php-v/dolejska-daniel/riot-api-valorant) |
42 changes: 42 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="phpunit.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
beStrictAboutOutputDuringTests="true"
>
<testsuites>
<!--
<testsuite name="BaseAPI:Library_Tests">
<directory>tests/Base/Library/</directory>
</testsuite>
<testsuite name="BaseAPI:Definition_Tests">
<directory>tests/Base/Definitions/</directory>
</testsuite>
<testsuite name="BaseAPI:Object_Tests">
<directory>tests/Base/Objects/</directory>
</testsuite>
-->
</testsuites>

<coverage cacheDirectory="build/cache/phpunit_coverage"
includeUncoveredFiles="true"
processUncoveredFiles="true"
pathCoverage="false"
ignoreDeprecatedCodeUnits="true"
disableCodeCoverageIgnore="true"
>
<include>
<directory suffix=".php">src/Base</directory>
</include>

<exclude>
<directory suffix=".php">vendor</directory>
</exclude>
</coverage>
</phpunit>

0 comments on commit 0a75a28

Please sign in to comment.