astronati / fantasy-football-quotations-parser
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.
Installs: 4 179
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 5
Requires
- php: >=7.4.0
- phpoffice/phpspreadsheet: ^1.16.0
Requires (Dev)
- phpstan/phpstan: ^0.12.77
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.5
- dev-master
- 3.2.0
- 3.1.0
- 3.0.0
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.0.0
- 0.2.1
- 0.2.0
- 0.1.0
- dev-dependabot/composer/phpoffice/phpspreadsheet-1.29.4
- dev-dependabot/composer/phpoffice/phpspreadsheet-1.29.2
- dev-issues/40-follow-up
- dev-issues/40
- dev-test
This package is auto-updated.
Last update: 2024-11-18 20:06:01 UTC
README
Fantasy Football Quotations Parser
Provides a way to parse files that are provided by main sport newspapers with players quotations after each soccer match of the Serie A and FIFA World Cup championship.
Supported Newspapers
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.
Installation
You can install the library and its dependencies using composer
running:
$ composer require astronati/fantasy-football-quotations-parser
Usage
The library allows to return a model per each quotation (player, vote, etc...).
Example
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(GazzettaMapSince2017::class); // Get the quotations, ready to be used $quotations = $quotationsParser->getQuotations('example/files/2017_quotazioni_gazzetta_02.xls');
Supported Formats
Take a look at the Gazzetta folder to know which formats are supported and at the QuotationsParserFactory to determine which constant using.
Quotation(s)
A Quotation instance allows to map a single row and to return information as follows:
$quotations[0]->isWithoutVote(); $quotations[0]->getGoalsMagicPoints();
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.