Passed
Push — master ( 48dfbb...b1038b )
by Yaroslav
02:16
created

ServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.037

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 9
ccs 4
cts 6
cp 0.6667
rs 10
cc 1
nc 1
nop 0
crap 1.037
1
<?php
2
3
namespace I18nStringsBatch;
4
5
use Illuminate\Support\Facades\Blade;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9 6
    public function boot()
10
    {
11
        /* @deprecated - phpstorm not supports num regex */
12 6
        Blade::directive('i18nBatch', function ($expression) {
13
            return "<?php echo i18n_strings_batch_json($expression); ?>";
14 6
        });
15
16 6
        Blade::directive('transBatch', function ($expression) {
17
            return "<?php echo i18n_strings_batch_json($expression); ?>";
18 6
        });
19 6
    }
20
21 6
    public function register()
22
    {
23 6
        $this->app->bind(I18nStringsBatchManager::class, function () {
24 6
            return new I18nStringsBatchManager();
25 6
        });
26 6
    }
27
}
28