Passed
Push — feature/add-gacela-cli ( 2018fc )
by Chema
05:13 queued 15s
created

CodeGeneratorFacade::parseArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\CodeGenerator;
6
7
use Gacela\CodeGenerator\Domain\CommandArguments\CommandArguments;
8
use Gacela\Framework\AbstractFacade;
9
10
/**
11
 * @method CodeGeneratorFactory getFactory()
12
 */
13
final class CodeGeneratorFacade 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