astronati/world-cups-data-response-parser

Allows to map responses provided by the World Cups Data Data API (stroccoli).

1.0.1 2018-06-11 09:34 UTC

This package is auto-updated.

Last update: 2024-04-06 09:00:39 UTC


README

Build Status Codacy Badge Latest Stable Version License

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:

$ 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:

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.

Development

The environment requires phpunit, 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:

$ composer install

Testing

Tests files are created in dedicates folders that replicate the 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:

$ composer test

Run what follows to see the code coverage:

$ composer coverage

License

This package is released under the MIT license.