| Total Complexity | 5 |
| Total Lines | 74 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Certificates extends ApiNfeFasa |
||
| 11 | { |
||
| 12 | /** @var array */ |
||
| 13 | private $headers; |
||
|
|
|||
| 14 | |||
| 15 | /** |
||
| 16 | * Certificates constructor. |
||
| 17 | * @param string $apiUrl |
||
| 18 | * @param string $token |
||
| 19 | * @param string $company_id |
||
| 20 | */ |
||
| 21 | public function __construct(string $apiUrl, string $token, string $company_id) |
||
| 22 | { |
||
| 23 | parent::__construct($apiUrl, $token); |
||
| 24 | $this->company = $company_id; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param array|null $headers |
||
| 29 | * @return Certificates |
||
| 30 | */ |
||
| 31 | public function index(?array $headers): Certificates |
||
| 32 | { |
||
| 33 | $this->request( |
||
| 34 | "GET", |
||
| 35 | "/companies/{$this->company}/certificates", |
||
| 36 | null, |
||
| 37 | $headers |
||
| 38 | ); |
||
| 39 | |||
| 40 | return $this; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param array $fields |
||
| 45 | * @return Certificates |
||
| 46 | */ |
||
| 47 | public function create(array $fields): Certificates |
||
| 48 | { |
||
| 49 | $this->request( |
||
| 50 | "POST", |
||
| 51 | "/companies/{$this->company}/certificates", |
||
| 52 | $fields |
||
| 53 | ); |
||
| 54 | |||
| 55 | return $this; |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @param string $certificate_id |
||
| 60 | * @return Certificates |
||
| 61 | */ |
||
| 62 | public function read(string $certificate_id): Certificates |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @param string $certificate_id |
||
| 74 | * @return Certificates |
||
| 75 | */ |
||
| 76 | public function delete(string $certificate_id): Certificates |
||
| 84 | } |
||
| 85 | } |