TaxServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 15
rs 9.4285
cc 3
eloc 10
nc 4
nop 0
1
<?php
2
3
namespace FeiMx\Tax;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class TaxServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12
    public function boot()
13
    {
14
        if (!class_exists('CreateTaxesTables')) {
15
            $timestamp = date('Y_m_d_His', time());
16
            $this->publishes([
17
                __DIR__.'/../database/migrations/create_taxes_tables.php.stub' => $this->app->databasePath()."/migrations/{$timestamp}_create_taxes_tables.php",
0 ignored issues
show
Bug introduced by
The method databasePath() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean basePath()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
18
            ], 'migrations');
19
        }
20
21
        if ($this->app->runningInConsole()) {
22
            $this->publishes([
23
                __DIR__.'/../config/tax.php' => config_path('tax.php'),
24
            ], 'config');
25
        }
26
    }
27
28
    /**
29
     * Register the application services.
30
     */
31
    public function register()
32
    {
33
        $this->mergeConfigFrom(__DIR__.'/../config/tax.php', 'tax');
34
    }
35
}
36