Completed
Push — master ( 2d40c2...8bc0f0 )
by Giancarlos
04:17
created

NoteBuilder::build()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Giansalex
5
 * Date: 01/10/2017
6
 * Time: 13:43
7
 */
8
9
namespace Greenter\Xml\Builder;
10
11
use Greenter\Model\DocumentInterface;
12
13
/**
14
 * Class NoteBuilder
15
 * @package Greenter\Xml\Builder
16
 */
17
class NoteBuilder extends TwigBuilder implements BuilderInterface
18
{
19
    /**
20
     * Create xml for document.
21
     *
22
     * @param DocumentInterface $document
23
     * @return string
24
     */
25 12
    public function build(DocumentInterface $document)
26
    {
27
        /**@var $document \Greenter\Model\Sale\Note */
28 12
        $template = $document->getTipoDoc() === '07'
29 12
            ? 'notacr.xml.twig' : 'notadb.xml.twig';
30
31 12
        return $this->render($template, $document);
32
    }
33
}