-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 13be361
Showing
83 changed files
with
14,814 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
vendor | ||
.idea | ||
tmp | ||
tests/_output/* | ||
index.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# RAWG Video Games Database PHP client | ||
|
||
This is RAWG PHP SDK. This library contains methods for interacting with RAWG API. | ||
|
||
## Installation | ||
|
||
`composer require dimuska139/rawg-sdk-php` | ||
|
||
## Usage | ||
|
||
```php | ||
require 'vendor/autoload.php'; | ||
use Rawg\ApiClient; | ||
use Rawg\Config; | ||
use Rawg\DateRange; | ||
use Rawg\Filters\GamesFilter; | ||
use Rawg\Filters\PaginationFilter; | ||
|
||
$cfg = new Config('YourAppName', 'en'); // 'YourAppName' will be set as User-Agent header | ||
$client = new ApiClient($cfg); | ||
|
||
$additionsFilter = (new PaginationFilter())->setPage(1)->setPageSize(5); | ||
print_r($client->games()->getAdditions(47, $additionsFilter)->getData()); | ||
|
||
$gamesFilter = (new GamesFilter()) | ||
->setPage(1) | ||
->setPageSize(20) | ||
->setDates([ | ||
DateRange::create(new DateTime( '2012-02-01' ), new DateTime( '2015-06-25' )) | ||
]) | ||
->setOrdering('-name') | ||
->setTags([1,2,3]); | ||
|
||
print_r($client->games()->getGames($gamesFilter)->getData()); | ||
``` | ||
|
||
The tests should be considered a part of the documentation. | ||
|
||
## License | ||
|
||
RAWG PHP SDK is released under the | ||
[MIT License](http://www.opensource.org/licenses/MIT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
paths: | ||
tests: tests | ||
output: tests/_output | ||
data: tests/_data | ||
support: tests/_support | ||
envs: tests/_envs | ||
actor_suffix: Tester | ||
extensions: | ||
enabled: | ||
- Codeception\Extension\RunFailed | ||
coverage: | ||
enabled: true | ||
show_only_summary: true | ||
include: | ||
- src/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "dimuska139/rawg-sdk-php", | ||
"description": "", | ||
"keywords": [ "php", "rawg", "sdk"], | ||
"homepage": "https://github.com/dimuska139/rawg-sdk-php", | ||
"type": "library", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Dmitriy Sviridov", | ||
"email": "dimuska139@gmail.com" | ||
} | ||
], | ||
"require": { | ||
"php": ">=7.0", | ||
"guzzlehttp/guzzle": "^7.0", | ||
"ext-json": "*", | ||
"lukasoppermann/http-status": "^2.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Rawg\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Rawg\\Tests\\": "tests/unit/" | ||
} | ||
}, | ||
"require-dev": { | ||
"codeception/codeception": "^4.1", | ||
"codeception/module-phpbrowser": "^1.0.0", | ||
"codeception/module-asserts": "^1.0.0" | ||
}, | ||
"scripts": { | ||
"test": "vendor/bin/codecept run unit --coverage-text --no-colors" | ||
} | ||
} |
Oops, something went wrong.