Skip to content

Commit

Permalink
added option in blade extractor for using blade facade instead of bla…
Browse files Browse the repository at this point in the history
…de compiler (#198)
  • Loading branch information
MarekGogol authored and oscarotero committed Dec 22, 2018
1 parent 545f716 commit e5e6366
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Extractors/Blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ class Blade extends Extractor implements ExtractorInterface
*/
public static function fromString($string, Translations $translations, array $options = [])
{
$cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath'];
$bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath);
$string = $bladeCompiler->compileString($string);
if (empty($options['facade'])) {
$cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath'];
$bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath);
$string = $bladeCompiler->compileString($string);
} else {
$string = $options['facade']::compileString($string);
}

PhpCode::fromString($string, $translations, $options);
}
Expand Down

0 comments on commit e5e6366

Please sign in to comment.