Passed
Push — add-command-list-modules ( fd1ae6 )
by Chema
11:55
created

ConsoleFacade::findAllAppModules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Console;
6
7
use Gacela\Console\Domain\AllAppModules\AppModule;
8
use Gacela\Console\Domain\CommandArguments\CommandArguments;
9
use Gacela\Framework\AbstractFacade;
10
11
/**
12
 * @method ConsoleFactory getFactory()
13
 */
14
final class ConsoleFacade extends AbstractFacade
15
{
16 9
    public function sanitizeFilename(string $filename): string
17
    {
18 9
        return $this->getFactory()
19 9
            ->createFilenameSanitizer()
20 9
            ->sanitize($filename);
21
    }
22
23 12
    public function parseArguments(string $desiredNamespace): CommandArguments
24
    {
25 12
        return $this->getFactory()
26 12
            ->createCommandArgumentsParser()
27 12
            ->parse($desiredNamespace);
28
    }
29
30 10
    public function generateFileContent(
31
        CommandArguments $commandArguments,
32
        string $filename,
33
        bool $withShortName = false,
34
    ): string {
35 10
        return $this->getFactory()
36 10
            ->createFileContentGenerator()
37 10
            ->generate($commandArguments, $filename, $withShortName);
38
    }
39
40
    /**
41
     * @return list<AppModule>
42
     */
43 2
    public function findAllAppModules(): array
44
    {
45 2
        return $this->getFactory()
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFactory...()->findAllAppModules() returns the type Gacela\Console\Domain\Al...dules\AppModule[]|array which is incompatible with the documented return type Gacela\Console\list.
Loading history...
46 2
            ->createAllAppModulesFinder()
47 2
            ->findAllAppModules();
48
    }
49
}
50