This library allows user to retrieve quotations from those documents that are provided from the most important sport newspapers. Quotations contains votes of each soccer player of a specific championship match day.
Currently the "Gazzetta dello Sport" is the only supported newspaper.
NOTE: To add another newspaper into the supported list, please provide us new kinds of files that need to be parsed in order to update the php package.
To do that please file a new issue.
You can install the library and its dependencies using
$ composer require astronati/fantasy-football-quotations-parser
The library allows to return a model per each quotation (player, vote, etc...).
The following snippet is extracted from the example/sample.php file and shows how parsing an excel file of the season 2017/2018
// Obtain a QuotationsParser $quotationsParser = QuotationsParserFactory::create(QuotationsParserFactory::FORMAT_GAZZETTA_SINCE_2017); // Get the quotations, ready to be used $quotations = $quotationsParser->getQuotations('example/files/2017_quotazioni_gazzetta_02.xls');
A Quotation instance allows to map a single row and to return information as follows:
The environment requires phpunit, that has been already included in the
dev-dependencies of the
To install all modules you just need to run following command:
$ composer install
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
This package is released under the MIT license.