Test Failed
Pull Request — stable (#351)
by
unknown
05:14
created

Provider::isAvailable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Laravel Zero.
7
 *
8
 * (c) Nuno Maduro <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace LaravelZero\Framework\Components\ScheduleList;
15
16
use function class_exists;
17
use Illuminate\Console\Application as Artisan;
18
use LaravelZero\Framework\Components\AbstractComponentProvider;
19
20
/**
21
 * @internal
22
 */
23
final class Provider extends AbstractComponentProvider
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function isAvailable(): bool
29
    {
30
        return class_exists(\Hmazter\LaravelScheduleList\ScheduleListServiceProvider::class) && is_array(
31
                $this->app['config']->get('schedule-list', false)
32
            );
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function register(): void
39
    {
40
        $this->app->register(\Hmazter\LaravelScheduleList\ScheduleListServiceProvider::class);
41
    }
42
}
43