Passed
Pull Request — master (#67)
by Laura
42:19
created

InvoiceFixture::getInvoice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace TddWizard\Fixtures\Sales;
5
6
use Magento\Sales\Api\Data\InvoiceInterface;
7
8
class InvoiceFixture
9
{
10
    /**
11
     * @var InvoiceInterface
12
     */
13
    private $invoice;
14
15 5
    public function __construct(InvoiceInterface $shipment)
16
    {
17 5
        $this->invoice = $shipment;
18 5
    }
19
20 4
    public function getInvoice(): int
21
    {
22 4
        return $this->invoice;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->invoice returns the type Magento\Sales\Api\Data\InvoiceInterface which is incompatible with the type-hinted return integer.
Loading history...
23
    }
24
25
    public function getId(): int
26
    {
27
        return (int) $this->invoice->getEntityId();
28
    }
29
}
30