Completed
Push — master ( d2652c...770afa )
by Abdelrahman
01:18
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
declare(strict_types=1);
4
5
namespace Rinvex\Repository\Providers;
6
7
use Illuminate\Support\ServiceProvider;
8
use Rinvex\Repository\Listeners\RepositoryEventListener;
9
10
class RepositoryServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * The repository alias pattern.
14
     *
15
     * @var string
16
     */
17
    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...
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function register()
23
    {
24
        // Merge config
25
        $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.repository');
26
27
        // Register the event listener
28
        $this->app->bind('rinvex.repository.listener', RepositoryEventListener::class);
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function boot()
35
    {
36
        if ($this->app->runningInConsole()) {
37
            // Publish config
38
            $this->publishes([realpath(__DIR__.'/../../config/config.php') => config_path('rinvex.repository.php')], 'rinvex-repository-config');
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 145 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
39
        }
40
41
        // Subscribe the registered event listener
42
        $this->app['events']->subscribe('rinvex.repository.listener');
43
    }
44
}
45