ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 84.62%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 3
b 0
f 0
dl 0
loc 22
ccs 11
cts 13
cp 0.8462
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A boot() 0 14 1
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
20 6
        $this->publishes([
21 6
            __DIR__ . '/../resources/' => public_path('vendor/i18n_strings_batch'),
22 6
        ], 'i18n-string-batch-resources');
23
    }
24
25 6
    public function register()
26
    {
27 6
        $this->app->bind(I18nStringsBatchManager::class, function () {
28 6
            return new I18nStringsBatchManager();
29 6
        });
30
    }
31
}
32