RepositoryServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the Laravel Platfourm package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\Platfourm\Repository;
12
13
use Illuminate\Support\ServiceProvider;
14
15
/**
16
 * Class RepositoryServiceProvider.
17
 */
18
class RepositoryServiceProvider extends ServiceProvider
19
{
20
    /**
21
     * Indicates if loading of the provider is deferred.
22
     *
23
     * @var bool
24
     */
25
    protected $defer = false;
26
27
    /**
28
     * @return void
29
     */
30
    public function boot()
31
    {
32
        $this->publishResources();
33
    }
34
35
    /**
36
     * Register the service provider.
37
     *
38
     * @return void
39
     */
40
    public function register()
41
    {
42
        $this->app->register('Longman\Platfourm\Repository\Providers\EventServiceProvider');
43
    }
44
45
    /**
46
     * Get the services provided by the provider.
47
     *
48
     * @return array
49
     */
50
    public function provides()
51
    {
52
        return [];
53
    }
54
55
    /**
56
     * Publish resources.
57
     *
58
     * @return void
59
     */
60
    private function publishResources()
61
    {
62
        // Merge configuration file
63
        $this->mergeConfigFrom([__DIR__ . '/config.php', 'database']);
0 ignored issues
show
Bug introduced by
The call to mergeConfigFrom() misses a required argument $key.

This check looks for function calls that miss required arguments.

Loading history...
Documentation introduced by
array(__DIR__ . '/config.php', 'database') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
64
    }
65
}
66