Passed
Push — feature/refactor-code-generato... ( fb1bf5 )
by Chema
04:20
created

ConsoleFacade::generateFileContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 8
rs 10
ccs 4
cts 4
cp 1
cc 1
nc 1
nop 3
crap 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 8
    public function sanitizeFilename(string $filename): string
16
    {
17 8
        return $this->getFactory()
18 8
            ->createFilenameSanitizer()
19 8
            ->sanitize($filename);
20
    }
21
22 10
    public function parseArguments(string $desiredNamespace): CommandArguments
23
    {
24 10
        return $this->getFactory()
25 10
            ->createCommandArgumentsParser()
26 10
            ->parse($desiredNamespace);
27
    }
28
29 10
    public function generateFileContent(
30
        CommandArguments $commandArguments,
31
        string $filename,
32
        bool $withShortName = false
33
    ): string {
34 10
        return $this->getFactory()
35 10
            ->createFileContentGenerator()
36 10
            ->generate($commandArguments, $filename, $withShortName);
37
    }
38
}
39