Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
6 / 6 |
| Linking | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
6 / 6 |
| __construct(Statement\BuilderInterface $parserBuilder, Compiler\BuilderInterface $compilerBuilder) | |
100.00% |
1 / 1 |
1 | |
100.00% |
3 / 3 |
|||
| run(\Iterator $iter) | |
100.00% |
1 / 1 |
1 | |
100.00% |
3 / 3 |
|||
| <?php | |
| /* | |
| * Mondrian | |
| */ | |
| namespace Trismegiste\Mondrian\Builder; | |
| use Trismegiste\Mondrian\Builder\Compiler; | |
| use Trismegiste\Mondrian\Builder\Statement; | |
| /** | |
| * Linking is making the link between the parser and the compiler | |
| * | |
| * It is a kind of director, but with directors and eventually it is a Facade | |
| */ | |
| class Linking | |
| { | |
| protected $parser; | |
| protected $compiler; | |
| public function __construct(Statement\BuilderInterface $parserBuilder, Compiler\BuilderInterface $compilerBuilder) | |
| { | |
| $this->parser = new Statement\Director($parserBuilder); | |
| $this->compiler = new Compiler\Director($compilerBuilder); | |
| } | |
| public function run(\Iterator $iter) | |
| { | |
| $stmts = $this->parser->parse($iter); | |
| $this->compiler->compile($stmts); | |
| } | |
| } |