Test Failed
Push — stable ( e76163...9c661a )
by Nuno
02:41
created

Provider::isAvailable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
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\Logo;
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 30
    public function isAvailable(): bool
29
    {
30 30
        return class_exists(\Zend\Text\Figlet\Figlet::class) && is_array(
0 ignored issues
show
Bug introduced by
The type Zend\Text\Figlet\Figlet was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
31 30
                $this->app['config']->get('logo', false)
32
            );
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function register(): void
39
    {
40
        $config = $this->app['config'];
41
42
        if ($config->get('logo.enabled', false)) {
43
            Artisan::starting(
44
                function ($artisan) use ($config) {
45
                    $artisan->setName(
46
                        new FigletString($config->get('app.name'), $config->get('logo', []))
47
                    );
48
                }
49
            );
50
        }
51
    }
52
}
53