Completed
Push — master ( 779423...f3e6b6 )
by Abdelrahman
01:22 queued 11s
created

TestimonialsServiceProvider::publishResources()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Testimonials\Providers;
6
7
use Illuminate\Support\ServiceProvider;
8
use Rinvex\Support\Traits\ConsoleTools;
9
use Rinvex\Testimonials\Models\Testimonial;
10
use Rinvex\Testimonials\Console\Commands\MigrateCommand;
11
use Rinvex\Testimonials\Console\Commands\PublishCommand;
12
use Rinvex\Testimonials\Console\Commands\RollbackCommand;
13
14
class TestimonialsServiceProvider extends ServiceProvider
15
{
16
    use ConsoleTools;
17
18
    /**
19
     * The commands to be registered.
20
     *
21
     * @var array
22
     */
23
    protected $commands = [
24
        MigrateCommand::class => 'command.rinvex.testimonials.migrate',
25
        PublishCommand::class => 'command.rinvex.testimonials.publish',
26
        RollbackCommand::class => 'command.rinvex.testimonials.rollback',
27
    ];
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function register()
33
    {
34
        // Merge config
35
        $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.testimonials');
36
37
        // Bind eloquent models to IoC container
38
        $this->app->singleton('rinvex.testimonials.testimonial', $testimonialModel = $this->app['config']['rinvex.testimonials.models.testimonial']);
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 149 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
        $testimonialModel === Testimonial::class || $this->app->alias('rinvex.testimonials.testimonial', Testimonial::class);
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 125 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...
40
41
        // Register console commands
42
        ! $this->app->runningInConsole() || $this->registerCommands();
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function boot()
49
    {
50
        // Publish Resources
51
        ! $this->app->runningInConsole() || $this->publishesConfig('rinvex/laravel-testimonials');
52
        ! $this->app->runningInConsole() || $this->publishesMigrations('rinvex/laravel-testimonials');
53
    }
54
}
55