/var/www/hkosl.com/demo_google/application/vendor/gettext/gettext/src/Extractors/Blade.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

namespace Gettext\Extractors;

use 
Gettext\Translations;
use 
Illuminate\Filesystem\Filesystem;
use 
Illuminate\View\Compilers\BladeCompiler;

/**
 * Class to get gettext strings from blade.php files returning arrays.
 */
class Blade extends Extractor implements ExtractorInterface
{
    
/**
     * {@inheritdoc}
     */
    
public static function fromString($stringTranslations $translations, array $options = [])
    {
        
$cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath'];
        
$bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath);
        
$string $bladeCompiler->compileString($string);

        
PhpCode::fromString($string$translations$options);
    }
}