Completed
Push — develop ( 0dcc7f...468796 )
by Abdelrahman
01:35
created

RepositoryServiceProvider::publishResources()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Repository Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Repository Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
namespace Rinvex\Repository\Providers;
17
18
use Illuminate\Support\ServiceProvider;
19
use Rinvex\Repository\Listeners\RepositoryEventListener;
20
21
class RepositoryServiceProvider extends ServiceProvider
22
{
23
    /**
24
     * The repository alias pattern.
25
     *
26
     * @var string
27
     */
28
    protected $repositoryAliasPattern = '{{class}}Contract';
0 ignored issues
show
Comprehensibility Naming introduced by
The variable name $repositoryAliasPattern exceeds the maximum configured length of 20.

Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.

Loading history...
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function register()
34
    {
35
        // Merge config
36
        $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.repository');
37
38
        // Register the event listener
39
        $this->app->bind('rinvex.repository.listener', RepositoryEventListener::class);
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function boot()
46
    {
47
        if ($this->app->runningInConsole()) {
0 ignored issues
show
Bug introduced by
The method runningInConsole() does not seem to exist on object<Illuminate\Contra...Foundation\Application>.

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...
48
            // Publish config
49
            $this->publishes([
50
                realpath(__DIR__.'/../../config/config.php') => config_path('rinvex.repository.php'),
51
            ], 'config');
52
        }
53
54
        // Subscribe the registered event listener
55
        $this->app['events']->subscribe('rinvex.repository.listener');
56
    }
57
}
58