InvoiceController::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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