CancellationServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 7 1
A register() 0 4 1
1
<?php
2
3
namespace Signifly\Cancellation;
4
5
use Illuminate\Database\Schema\Blueprint;
6
use Illuminate\Support\ServiceProvider;
7
8
class CancellationServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        $this->publishes([
18
            __DIR__.'/../config/cancellation.php' => config_path('cancellation.php'),
19
        ], 'config');
20
21
        $this->mergeConfigFrom(__DIR__.'/../config/cancellation.php', 'cancellation');
22
    }
23
24
    /**
25
     * Register the service provider.
26
     *
27
     * @return void
28
     */
29
    public function register()
30
    {
31
        Blueprint::macro('cancellable', function () {
32
            return $this->timestamp('cancelled_at')->nullable();
0 ignored issues
show
Bug introduced by
The method timestamp() does not exist on Signifly\Cancellation\CancellationServiceProvider. ( Ignorable by Annotation )

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

32
            return $this->/** @scrutinizer ignore-call */ timestamp('cancelled_at')->nullable();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
33
        });
34
    }
35
}
36