Completed
Push — master ( bede32...b36525 )
by Julián
02:33
created

ConsoleBuilder::getBuilders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * doctrine-manager-builder (https://github.com/juliangut/doctrine-manager-builder)
4
 * Doctrine2 managers builder
5
 *
6
 * @license BSD-3-Clause
7
 * @author Julián Gutiérrez <[email protected]>
8
 */
9
10
namespace Jgut\Doctrine\ManagerBuilder;
11
12
use Symfony\Component\Console\Application;
13
14
/**
15
 * Console builder.
16
 */
17
class ConsoleBuilder extends AbstractBuilderCollection
18
{
19
    /**
20
     * Get console application.
21
     *
22
     * @return Application
23
     */
24
    public function getApplication()
25
    {
26
        $application = new Application('Doctrine Manager Builder Command Line Interface');
27
        $application->setCatchExceptions(true);
28
29
        foreach ($this->builders as $builder) {
30
            $helperSet = $builder->getConsoleHelperSet();
31
32
            foreach ($builder->getConsoleCommands() as $command) {
33
                $application->add($command)->setHelperSet($helperSet);
34
            }
35
        }
36
37
        return $application;
38
    }
39
}
40