From 0a75a2890b4ab082b448d7aeb4453f0253052d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Dolej=C5=A1ka?= Date: Sun, 24 Jan 2021 13:37:45 +0100 Subject: [PATCH] README and Tests update --- README.md | 62 +++++++++++++++++++++++++---------------------------- phpunit.xml | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 33 deletions(-) create mode 100644 phpunit.xml diff --git a/README.md b/README.md index 642c5be..b39d251 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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. @@ -56,14 +52,14 @@ echo DataDragonAPI::getChampionLoading('Orianna', 7); **Output**: ```html -Orianna -Orianna +Orianna +Orianna ``` **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? @@ -78,16 +74,16 @@ echo DataDragonAPI::getItemIcon(3138); **Output**: ```html -3132 -3126 -3138 +3132 +3126 +3138 ``` **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? @@ -107,19 +103,19 @@ foreach($orianna->spells as $spell) ```html Orianna -OrianaIzunaCommand -OrianaDissonanceCommand -OrianaRedactCommand -OrianaDetonateCommand +OrianaIzunaCommand +OrianaDissonanceCommand +OrianaRedactCommand +OrianaDetonateCommand ``` **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). @@ -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) | diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..234d072 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,42 @@ + + + + + + + + + src/Base + + + + vendor + + + \ No newline at end of file