Test Failed
Pull Request — stable (#292)
by Victor
01:58
created

Provider::isAvailable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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);
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
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function register(): void
37
    {
38
        $config = $this->app['config'];
39
40
        if ($config->get('logo.enabled', false)) {
41
            Artisan::starting(
42
                function ($artisan) use ($config) {
43
                    $artisan->setName(
44
                        new FigletString($config->get('app.name'), $config->get('logo', []))
45
                    );
46
                }
47
            );
48
        }
49
    }
50
}
51