| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function register(ContainerInterface $app) |
||
| 18 | { |
||
| 19 | $app->closure(Twig_Environment::class, function () { |
||
| 20 | $loader = new Twig_Loader_Filesystem(path(config('view.path'))); |
||
| 21 | $options = []; |
||
| 22 | $cachePath = config('view.cache'); |
||
| 23 | if ($cachePath) { |
||
| 24 | $options['cache'] = path($cachePath); |
||
| 25 | } |
||
| 26 | return new Twig_Environment($loader, $options); |
||
| 27 | }); |
||
| 28 | $app->closure(RenderInterface::class, function ($app) { |
||
| 29 | return new TwigView($app[Twig_Environment::class]); |
||
| 30 | }); |
||
| 31 | } |
||
| 32 | |||
| 40 |