1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author stev leibelt <[email protected]> |
4
|
|
|
* @since 2015-05-31 |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
namespace Net\Bazzline\Component\Locator; |
8
|
|
|
|
9
|
|
|
use Net\Bazzline\Component\Locator\Configuration\ConfigurationFactory; |
10
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\Generator\ArgumentsGenerator; |
11
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\Assembler\ConfigurationAssembler; |
12
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\Generator\FactoryGenerator; |
13
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\Generator\FileExistsStrategyGenerator; |
14
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\Generator\InvalidArgumentExceptionFileGenerator; |
15
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\FileLoader\IfAvailableBootstrapFileLoader; |
16
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\FileLoader\ConfigurationFileLoader; |
17
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\Generator\LocatorFileGenerator; |
18
|
|
|
use Net\Bazzline\Component\Locator\Process\Transformer\Generator\LocatorInterfaceFileGenerator; |
19
|
|
|
use Net\Bazzline\Component\Locator\Process\Validator\ArgumentsValidator; |
20
|
|
|
use Net\Bazzline\Component\Locator\Process\Validator\ConfigurationDataValidator; |
21
|
|
|
use Net\Bazzline\Component\Locator\Process\Validator\ConfigurationValidator; |
22
|
|
|
use Net\Bazzline\Component\Locator\Process\Validator\IsCommandLineValidator; |
23
|
|
|
use Net\Bazzline\Component\ProcessPipe\Pipe; |
24
|
|
|
|
25
|
|
|
class ProcessPipeFactory |
26
|
|
|
{ |
27
|
|
|
/** |
28
|
|
|
* @return Pipe |
29
|
|
|
*/ |
30
|
|
|
public function create() |
31
|
|
|
{ |
32
|
|
|
$configurationFactory = new ConfigurationFactory(); |
33
|
|
|
|
34
|
|
|
$configurationAssembler = new ConfigurationAssembler(); |
35
|
|
|
$configurationAssembler->setConfiguration($configurationFactory->create()); |
36
|
|
|
|
37
|
|
|
//-------------------------------- |
38
|
|
|
//bin/generator |
39
|
|
|
// -> fetch cli arguments |
40
|
|
|
// -> fetch configuration as object |
41
|
|
|
// -> generate |
42
|
|
|
//generate |
43
|
|
|
// -> setup |
44
|
|
|
// -> assemble data |
45
|
|
|
// -> generate files |
46
|
|
|
//assemble |
47
|
|
|
// -> assert mandatory properties |
48
|
|
|
// -> validate data |
49
|
|
|
// -> map data |
50
|
|
|
//generate |
51
|
|
|
// -> validate output path |
52
|
|
|
// -> generate locator |
53
|
|
|
// -> generate factory interface |
54
|
|
|
// -> generate exception |
55
|
|
|
//-------------------------------- |
56
|
|
|
|
57
|
|
|
$pipe = new Pipe( |
58
|
|
|
new IsCommandLineValidator(), |
59
|
|
|
new ArgumentsGenerator(), |
60
|
|
|
new ArgumentsValidator(), |
61
|
|
|
new ConfigurationFileLoader(), |
62
|
|
|
new ConfigurationDataValidator(), |
63
|
|
|
new IfAvailableBootstrapFileLoader(), |
64
|
|
|
$configurationAssembler, |
65
|
|
|
new FileExistsStrategyGenerator(), |
66
|
|
|
new ConfigurationValidator(), |
67
|
|
|
new FactoryGenerator(), |
68
|
|
|
new LocatorFileGenerator(), |
69
|
|
|
new InvalidArgumentExceptionFileGenerator(), |
70
|
|
|
new LocatorInterfaceFileGenerator() |
71
|
|
|
); |
72
|
|
|
|
73
|
|
|
return $pipe; |
74
|
|
|
} |
75
|
|
|
} |