icemad / ptcgl-decklist-parser
Library to parse decklist from Pokemon TCG Live
Installs: 78
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/icemad/ptcgl-decklist-parser
Requires
- php: >=8.4
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- rregeer/phpunit-coverage-check: ^0.3.1
README
A parser for Pokemon TCG Live decklist
Features
- Decklist Parsing: Convert PTCGL decklist string into structured data for analysis or transformation.
- Decklist Formatting: Convert back structured data to decklist string.
Installation
To include this parser in your project, you can install it via Composer:
composer require icemad/ptcgl-decklist-parser
Usage
Parsing
$parser = new DecklistParser([ new CardLineParser(), new CategoryLineParser(), ]); $result = $parser->parse($deckList) // string containing decklist
The output is an instance of Icemad\PtcglDecklistParser\Model\ParsingResult.
It the parsing is successful, ParsingResult::getParsingFailures should return an empty array.
Formatting
$string = new DecklistFormatter()->format($result->getParsedLines());