| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 15 | public function transpileFeature(string $sourceFileContents, FeatureInterface ...$features): string |
|
| 18 | { |
||
| 19 | 15 | $parser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7); |
|
| 20 | 15 | $nodes = $parser->parse($sourceFileContents); |
|
| 21 | |||
| 22 | 15 | $search = new NodeSearch($nodes); |
|
| 23 | |||
| 24 | 15 | foreach ($features as $feature) { |
|
| 25 | 15 | $feature->fix($search); |
|
| 26 | } |
||
| 27 | |||
| 28 | 15 | $prettyPrinter = new Standard(); |
|
| 29 | |||
| 30 | 15 | return $prettyPrinter->prettyPrintFile($search->getTree()); |
|
| 31 | } |
||
| 32 | } |
||
| 33 |