ClassGeneratorFacadeDefault::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 5
dl 0
loc 8
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[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 Micro\Library\DTO;
15
16
use Psr\Log\LoggerInterface;
17
18
class ClassGeneratorFacadeDefault extends GeneratorFacade
19
{
20
    /**
21
     * @param array<string>        $filesSchemeCollection
22
     * @param string               $outputPath
23
     * @param string               $namespaceGeneral
24
     * @param string               $classSuffix
25
     * @param LoggerInterface|null $logger
26
     */
27 6
    public function __construct(
28
        private array $filesSchemeCollection,
29
        private string $outputPath,
30
        private string $namespaceGeneral = '',
31
        private string $classSuffix = 'Transfer',
32
        private null|LoggerInterface $logger = null
33
    ) {
34 6
        parent::__construct($this->createDefaultDependencyInjectionObject());
35
    }
36
37
    /**
38
     * @return DependencyInjectionInterface
39
     */
40 6
    protected function createDefaultDependencyInjectionObject(): DependencyInjectionInterface
41
    {
42 6
        return new DependencyInjection(
43 6
            $this->filesSchemeCollection,
44 6
            $this->namespaceGeneral,
45 6
            $this->classSuffix,
46 6
            $this->outputPath,
47 6
            $this->logger
48 6
        );
49
    }
50
}
51