NewInstanceBuilder::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * @author stev leibelt <[email protected]>
4
 * @since 2014-06-13 
5
 */
6
7
namespace Net\Bazzline\Component\Locator\MethodBodyBuilder;
8
9
use Net\Bazzline\Component\CodeGenerator\BlockGenerator;
10
11
/**
12
 * Class NewInstanceBuilder
13
 * @package Net\Bazzline\Component\Locator\MethodBodyBuilder
14
 */
15 View Code Duplication
class NewInstanceBuilder extends AbstractMethodBodyBuilder
16
{
17
    /**
18
     * @param BlockGenerator $body
19
     * @return BlockGenerator
20
     * @throws RuntimeException
21
     */
22
    public function build(BlockGenerator $body)
23
    {
24
        $this->assertMandatoryProperties();
25
26
        $body
27
            ->add('return new ' . $this->instance->getClassName() . '();');
28
29
        return $body;
30
    }
31
}