1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* This file is part of phpDocumentor. |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
* |
10
|
|
|
* @author Mike van Riel <[email protected]> |
11
|
|
|
* @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com) |
12
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT |
13
|
|
|
* @link http://phpdoc.org |
14
|
|
|
*/ |
15
|
|
|
|
16
|
|
|
namespace phpDocumentor\Parser; |
17
|
|
|
|
18
|
|
|
use phpDocumentor\Reflection\DocBlockFactory; |
19
|
|
|
use phpDocumentor\Reflection\Php\Factory; |
20
|
|
|
use phpDocumentor\Reflection\Php\NodesFactory; |
21
|
|
|
use phpDocumentor\Reflection\Php\ProjectFactory; |
22
|
|
|
use phpDocumentor\Reflection\PrettyPrinter; |
23
|
|
|
|
24
|
|
|
final class ProjectFactoryFactory |
25
|
|
|
{ |
26
|
|
|
public static function create(iterable $fileMiddlewaresBuilder): ProjectFactory |
27
|
|
|
{ |
28
|
|
|
$fileMiddlewares = []; |
29
|
|
|
foreach ($fileMiddlewaresBuilder as $middleware) { |
30
|
|
|
$fileMiddlewares[] = $middleware; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
$strategies = [ |
34
|
|
|
new Factory\Argument(new PrettyPrinter()), |
35
|
|
|
new Factory\Class_(), |
36
|
|
|
new Factory\Constant(new PrettyPrinter()), |
37
|
|
|
new Factory\DocBlock(DocBlockFactory::createInstance()), |
38
|
|
|
new Factory\Function_(), |
39
|
|
|
new Factory\Interface_(), |
40
|
|
|
new Factory\Method(), |
41
|
|
|
new Factory\Property(new PrettyPrinter()), |
42
|
|
|
new Factory\Trait_(), |
43
|
|
|
new Factory\File( |
44
|
|
|
NodesFactory::createInstance(), |
45
|
|
|
$fileMiddlewares |
46
|
|
|
), |
47
|
|
|
]; |
48
|
|
|
|
49
|
|
|
return new ProjectFactory($strategies); |
50
|
|
|
} |
51
|
|
|
} |
52
|
|
|
|