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\Plugin\DTO; |
15
|
|
|
|
16
|
|
|
use Micro\Framework\Kernel\Configuration\PluginConfiguration; |
17
|
|
|
|
18
|
|
|
class DTOPluginConfiguration extends PluginConfiguration implements DTOPluginConfigurationInterface |
19
|
|
|
{ |
20
|
|
|
protected const CFG_CLASS_NAMESPACE_GENERAL = 'DTO_CLASS_NAMESPACE_GENERAL'; |
21
|
|
|
protected const CFG_CLASS_SUFFIX = 'DTO_CLASS_SUFFIX'; |
22
|
|
|
protected const CFG_CLASS_SOURCE_PATH = 'DTO_CLASS_SOURCE_PATH'; |
23
|
|
|
protected const CFG_CLASS_SOURCE_FILE_MASK = 'DTO_CLASS_SOURCE_FILE_MASK'; |
24
|
|
|
protected const CFG_GENERATED_PATH_OUTPUT = 'DTO_GENERATED_PATH_OUTPUT'; |
25
|
|
|
protected const CFG_LOGGER_NAME = 'DTO_LOGGER_NAME'; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* {@inheritDoc} |
29
|
|
|
*/ |
30
|
2 |
|
public function getNamespaceGeneral(): string |
31
|
|
|
{ |
32
|
2 |
|
return $this->configuration->get(self::CFG_CLASS_NAMESPACE_GENERAL, 'App\DTO\Generated'); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* {@inheritDoc} |
37
|
|
|
*/ |
38
|
2 |
|
public function getOutputPath(): string |
39
|
|
|
{ |
40
|
2 |
|
return $this->configuration->get(self::CFG_GENERATED_PATH_OUTPUT, 'src/Generated'); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* {@inheritDoc} |
45
|
|
|
*/ |
46
|
2 |
|
public function getClassSuffix(): string |
47
|
|
|
{ |
48
|
2 |
|
return $this->configuration->get(self::CFG_CLASS_SUFFIX, 'Transfer'); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* {@inheritDoc} |
53
|
|
|
*/ |
54
|
3 |
|
public function getSchemaPaths(): iterable |
55
|
|
|
{ |
56
|
3 |
|
return $this->explodeStringToArray( |
57
|
3 |
|
$this->configuration->get(self::CFG_CLASS_SOURCE_PATH, []) |
58
|
3 |
|
); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* {@inheritDoc} |
63
|
|
|
*/ |
64
|
3 |
|
public function getSourceFileMask(): string |
65
|
|
|
{ |
66
|
3 |
|
return $this->configuration->get(self::CFG_CLASS_SOURCE_FILE_MASK, '*.transfer.xml'); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* {@inheritDoc} |
71
|
|
|
*/ |
72
|
2 |
|
public function getLoggerName(): string|null |
73
|
|
|
{ |
74
|
2 |
|
return $this->configuration->get(self::CFG_LOGGER_NAME); |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|