GenericInvoiceProcessor   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 41
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAlias() 0 4 1
A save() 0 4 1
A void() 0 4 1
A download() 0 3 1
A send() 0 3 1
1
<?php
2
3
namespace WellCommerce\Bundle\InvoiceBundle\Processor;
4
5
use Symfony\Component\HttpFoundation\Response;
6
use WellCommerce\Bundle\CoreBundle\Helper\Pdf\PdfHelperInterface;
7
use WellCommerce\Bundle\InvoiceBundle\Entity\Invoice;
8
use WellCommerce\Bundle\InvoiceBundle\Generator\InvoiceNumberGeneratorInterface;
9
10
/**
11
 * Class GenericInvoiceProcessor
12
 *
13
 * @author  Adam Piotrowski <[email protected]>
14
 */
15
final class GenericInvoiceProcessor implements InvoiceProcessorInterface
16
{
17
    /**
18
     * @var InvoiceNumberGeneratorInterface
19
     */
20
    private $invoiceNumberGenerator;
21
    
22
    /**
23
     * @var PdfHelperInterface
24
     */
25
    private $pdfHelper;
26
    
27
    public function __construct(InvoiceNumberGeneratorInterface $invoiceNumberGenerator, PdfHelperInterface $pdfHelper)
28
    {
29
        $this->invoiceNumberGenerator = $invoiceNumberGenerator;
30
        $this->pdfHelper              = $pdfHelper;
31
    }
32
    
33
    public function getAlias(): string
34
    {
35
        return 'generic';
36
    }
37
    
38
    public function save(Invoice $invoice)
39
    {
40
        $this->invoiceNumberGenerator->generate($invoice);
41
    }
42
    
43
    public function void(Invoice $invoice)
44
    {
45
    
46
    }
47
    
48
    public function download(Invoice $invoice): Response
49
    {
50
    }
51
    
52
    public function send(Invoice $invoice)
53
    {
54
    }
55
}
56