ProductInvoices   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A read() 0 8 1
1
<?php
2
3
namespace WagnerMontanini\ApiNfeFasa;
4
5
use WagnerMontanini\ApiNfeFasa\Companies;
6
7
/**
8
 * Class ProductInvoices
9
 * @package WagnerMontanini\ApiNfeFasa
10
 */
11
class ProductInvoices extends ApiNfeFasa
12
{
13
    /** @var array */
14
    private $headers;
0 ignored issues
show
introduced by
The private property $headers is not used, and could be removed.
Loading history...
15
16
    /**
17
     * ProductInvoices constructor
18
     * @param string $apiUrl
19
     * @param string $token
20
     * @param string $company_id
21
     */
22
    public function __construct(string $apiUrl, string $token, string $company_id)
23
    {   
24
        parent::__construct($apiUrl, $token);
25
        $this->company = $company_id;
0 ignored issues
show
Bug Best Practice introduced by
The property company does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
26
    }
27
28
    /**
29
     * @param string $access_key
30
     * @return ProductInvoices
31
     */
32
    public function read(string $access_key): ProductInvoices
33
    {
34
        $this->request(
35
            "GET",
36
            "/companies/{$this->company}/productinvoices/{$access_key}",
37
        );
38
39
        return $this;
40
    }
41
}