Passed
Push — feature/create-console-bootstr... ( abaeda )
by Chema
04:15
created

ConsoleFacade   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 24
rs 10
c 0
b 0
f 0
ccs 0
cts 12
cp 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A parseArguments() 0 5 1
A generateFileContent() 0 8 1
A sanitizeFilename() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Console;
6
7
use Gacela\Console\Domain\CommandArguments\CommandArguments;
8
use Gacela\Framework\AbstractFacade;
9
10
/**
11
 * @method ConsoleFactory getFactory()
12
 */
13
final class ConsoleFacade extends AbstractFacade
14
{
15
    public function sanitizeFilename(string $filename): string
16
    {
17
        return $this->getFactory()
18
            ->createFilenameSanitizer()
19
            ->sanitize($filename);
20
    }
21
22
    public function parseArguments(string $desiredNamespace): CommandArguments
23
    {
24
        return $this->getFactory()
25
            ->createCommandArgumentsParser()
26
            ->parse($desiredNamespace);
27
    }
28
29
    public function generateFileContent(
30
        CommandArguments $commandArguments,
31
        string $filename,
32
        bool $withShortName = false
33
    ): string {
34
        return $this->getFactory()
35
            ->createFileContentGenerator()
36
            ->generate($commandArguments, $filename, $withShortName);
37
    }
38
}
39