Completed
Push — master ( 7f4390...3bc56b )
by Michael
01:29
created

LaravelEfficientUuidServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 28
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 10 1
1
<?php
2
3
namespace Dyrynda\Database;
4
5
use Illuminate\Database\Connection;
6
use Illuminate\Support\ServiceProvider;
7
use Illuminate\Database\Schema\Blueprint;
8
use Dyrynda\Database\Connection\MySqlConnection;
9
10
class LaravelEfficientUuidServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Bootstrap any application services.
14
     *
15
     * @return void
16
     */
17 1
    public function boot()
18
    {
19
        //
20 1
    }
21
22
    /**
23
     * Register any application services.
24
     *
25
     * @return void
26
     */
27 1
    public function register()
28
    {
29
        Connection::resolverFor('mysql', function ($connection, $database, $prefix, $config) {
30
            return new MySqlConnection($connection, $database, $prefix, $config);
31 1
        });
32
33
        Blueprint::macro('efficientUuid', function ($column) {
34 1
            return $this->addColumn('efficientUuid', $column);
0 ignored issues
show
Bug introduced by
The method addColumn() does not seem to exist on object<Dyrynda\Database\...entUuidServiceProvider>.

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...
35 1
        });
36 1
    }
37
}
38