ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 5 1
A register() 0 10 1
1
<?php
2
3
namespace Fomvasss\LaravelTranslatable;
4
5
use Illuminate\Database\Schema\Blueprint;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->publishes([
17
            __DIR__ . '/../config/translatable.php' => config_path('translatable.php')
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
            __DIR__ . '/../config/translatable.php' => /** @scrutinizer ignore-call */ config_path('translatable.php')
Loading history...
18
        ], 'config');
19
    }
20
21
    /**
22
     * Register the application services.
23
     *
24
     * @return void
25
     */
26
    public function register()
27
    {
28
        $this->mergeConfigFrom(__DIR__ . '/../config/translatable.php', 'translatable');
29
30
        Blueprint::macro('translatable', function () {
31
            TranslatableColumns::columns($this);
0 ignored issues
show
Bug introduced by
$this of type Fomvasss\LaravelTranslatable\ServiceProvider is incompatible with the type Illuminate\Database\Schema\Blueprint expected by parameter $table of Fomvasss\LaravelTranslat...tableColumns::columns(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
            TranslatableColumns::columns(/** @scrutinizer ignore-type */ $this);
Loading history...
32
        });
33
34
        Blueprint::macro('dropTranslatable', function () {
35
            TranslatableColumns::dropColumns($this);
0 ignored issues
show
Bug introduced by
$this of type Fomvasss\LaravelTranslatable\ServiceProvider is incompatible with the type Illuminate\Database\Schema\Blueprint expected by parameter $table of Fomvasss\LaravelTranslat...eColumns::dropColumns(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

35
            TranslatableColumns::dropColumns(/** @scrutinizer ignore-type */ $this);
Loading history...
36
        });
37
38
    }
39
}
40