Skip to content

Repository files navigation

FilmTools · Parser

Installation

$ composer require filmtools/parser

Usage

Creating the Parser object

<?phpuseFilmTools\Parser\ParserFactory;
useFilmTools\Parser\ParserExceptionInterface;
$factory = newParserFactory;
try { $parser = $factory("data.csv");
}
catch (ParserExceptionInterface$e) {
echo$e->getMessage();
// "Invalid file extension ..."
}

Parsing the data

try {
$records = $parser->parse("data.csv");
$records = $parser->parseString( file_get_contents("data.csv"));
foreach($recordsas$row):
// Do things with \Traversableendforeach; }
catch (ParserExceptionInterface$e) {
echo$e->getMessage();
// "File not found ..." // or s.th. like that
}

Unit Tests

Nope, sorry … cough

About

File Parser for film developing data files

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages