Completed
Push — develop ( 141adb...8f70d4 )
by Jaap
05:39
created

InitializeBuilderFromConfig   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of phpDocumentor.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @author    Mike van Riel <[email protected]>
12
 * @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com)
13
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
14
 * @link      http://phpdoc.org
15
 */
16
17
namespace phpDocumentor\Application\Stage;
18
19
use phpDocumentor\Application\Stage\Payload;
20
use phpDocumentor\Descriptor\Collection as PartialsCollection;
21
22
final class InitializeBuilderFromConfig
23
{
24
    private $partials;
25
26
    public function __construct(PartialsCollection $partials)
27
    {
28
        $this->partials = $partials;
29
    }
30
31
    public function __invoke(Payload $payload)
32
    {
33
        $configuration = $payload->getConfig();
34
35
        $builder = $payload->getBuilder();
36
        $builder->createProjectDescriptor();
37
        $builder->setName($configuration['phpdocumentor']['title']);
38
        $builder->setPartials($this->partials);
39
40
        return $payload;
41
    }
42
}
43