Test Failed
Push — stable ( 977f63...62e79c )
by Nuno
02:59
created

ComponentProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isAvailable() 0 4 1
A register() 0 8 1
1
<?php
2
3
namespace LaravelZero\Framework\Commands\Component\Illuminate\Log;
4
5
use LaravelZero\Framework\Commands\Component\AbstractComponentProvider;
6
7
/**
8
 * This is the Laravel Zero Framework illuminate/log component provider class.
9
 *
10
 * @author Nuno Maduro <[email protected]>
11
 */
12
class ComponentProvider extends AbstractComponentProvider
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function isAvailable(): bool
18
    {
19
        return class_exists(\Illuminate\Log\LogServiceProvider::class);
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function register(): void
26
    {
27
        $this->registerServiceProvider(\Illuminate\Log\LogServiceProvider::class);
28
29
        $this->app->alias('log', \Illuminate\Log\Writer::class);
30
        $this->app->alias('log', \Illuminate\Contracts\Logging\Log::class);
31
        $this->app->alias('log', \Psr\Log\LoggerInterface::class);
32
    }
33
}
34