InvoiceController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 31
ccs 8
cts 8
cp 1
rs 10
wmc 2
lcom 0
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __invoke() 0 6 1
1
<?php
2
3
namespace Sausin\Signere\Http\Controllers\Admin;
4
5
use Sausin\Signere\Invoice;
6
use Sausin\Signere\Http\Controllers\Controller;
7
8
class InvoiceController extends Controller
9
{
10
    /** @var \Sausin\Signere\Invoice */
11
    protected $invoice;
12
13
    /**
14
     * Create a new controller instance.
15
     *
16
     * @param  \Sausin\Signere\Invoice $invoice
17
     */
18 1
    public function __construct(Invoice $invoice)
19
    {
20 1
        parent::__construct();
21
22 1
        $this->invoice = $invoice;
23 1
    }
24
25
    /**
26
     * Returns a list of invoice transactions for the given month.
27
     *
28
     * @param  int    $year
29
     * @param  int    $month
30
     * @return \Illuminate\Http\Response
31
     */
32 1
    public function __invoke(int $year, int $month)
33
    {
34 1
        return $this->invoice->get($year, $month)
35 1
                ->getBody()
36 1
                ->getContents();
37
    }
38
}
39