Blade   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromString() 0 8 2
1
<?php
2
3
namespace Gettext\Extractors;
4
5
use Gettext\Translations;
6
use Illuminate\Filesystem\Filesystem;
7
use Illuminate\View\Compilers\BladeCompiler;
8
9
/**
10
 * Class to get gettext strings from blade.php files returning arrays.
11
 */
12
class Blade extends Extractor implements ExtractorInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public static function fromString($string, Translations $translations, array $options = [])
18
    {
19
        $cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath'];
20
        $bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath);
21
        $string = $bladeCompiler->compileString($string);
22
23
        PhpCode::fromString($string, $translations, $options);
24
    }
25
}
26