https://github.com/astronati/php-world-cups-data-response-parser
Allows to map responses provided by the World Cups Data Data API (stroccoli).
https://github.com/astronati/php-world-cups-data-response-parser
api fantasy-football marketshape php7 plugin stroccoli world-cup-2018
Last synced: 4 months ago
JSON representation
Allows to map responses provided by the World Cups Data Data API (stroccoli).
- Host: GitHub
- URL: https://github.com/astronati/php-world-cups-data-response-parser
- Owner: astronati
- License: mit
- Created: 2018-06-06T14:03:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-11T09:36:54.000Z (about 7 years ago)
- Last Synced: 2025-01-22T22:12:18.689Z (6 months ago)
- Topics: api, fantasy-football, marketshape, php7, plugin, stroccoli, world-cup-2018
- Language: PHP
- Homepage: https://astronati.github.io/php-world-cups-data-response-parser/
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://travis-ci.org/astronati/php-world-cups-data-response-parser)
[](https://www.codacy.com/app/astronati/php-world-cups-data-response-parser?utm_source=github.com&utm_medium=referral&utm_content=astronati/php-world-cups-data-response-parser&utm_campaign=Badge_Grade)
[](https://packagist.org/packages/astronati/world-cups-data-response-parser)
[](https://packagist.org/packages/astronati/world-cups-data-response-parser)# World Cups Data Response Parser (Stoccoli)
Allows to map responses provided by the World Cups Data API.## Installation
You can install the library and its dependencies using `composer` running:
```sh
$ composer require astronati/world-cups-data-response-parser
```### Usage
The library allows to return a model per each response and its content (round, match, team, etc...).##### Example
The following snippet can be helpful:```php
use WCDRP\Response\ResponseParser;
...
// Obtain a Response
$apiResponse = ... // Save this the response from the World Cups Data API
$response = ResponseParser::create($apiResponse);
...
// Get first round
$round = $response->getRounds()[0];
echo $round->getNumber(); // 1...
```For more details please take a look at [Response](https://github.com/astronati/php-world-cups-data-response-parser/tree/master/src/Response).
## Development
The environment requires [phpunit](https://phpunit.de/), that has been already included in the `dev-dependencies` of the
`composer.json`.### Dependencies
To install all modules you just need to run following command:```sh
$ composer install
```### Testing
Tests files are created in dedicates folders that replicate the
[src](https://github.com/astronati/php-world-cups-data-response-parser/tree/master/src) structure as follows:
```
.
+-- src
| +-- [folder-name]
| | +-- [file-name].php
| ...
+-- tests
| +-- [folder-name]
| | +-- [file-name]Test.php
```Execute following command to run the tests suite:
```sh
$ composer test
```Run what follows to see the code coverage:
```sh
$ composer coverage
```## License
This package is released under the [MIT license](LICENSE.md).