Issues (9)

src/ProductInvoices.php (2 issues)

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
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
}