| Total Complexity | 6 | 
| Total Lines | 72 | 
| Duplicated Lines | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 10 | class Invoices extends CafeApi  | 
            ||
| 11 | { | 
            ||
| 12 | /**  | 
            ||
| 13 | * Invoices constructor  | 
            ||
| 14 | * @param string $api_url  | 
            ||
| 15 | * @param string $email  | 
            ||
| 16 | * @param string $password  | 
            ||
| 17 | */  | 
            ||
| 18 | public function __construct(string $api_url, string $email, string $password)  | 
            ||
| 21 | }  | 
            ||
| 22 | |||
| 23 | /**  | 
            ||
| 24 | * Index  | 
            ||
| 25 | * @param array|null $headers  | 
            ||
| 26 | * @return Invoices  | 
            ||
| 27 | */  | 
            ||
| 28 | public function index(?array $headers): Invoices  | 
            ||
| 29 |     { | 
            ||
| 30 |         $this->request('GET', '/invoices', null, $headers); | 
            ||
| 31 | |||
| 32 | return $this;  | 
            ||
| 33 | }  | 
            ||
| 34 | |||
| 35 | /**  | 
            ||
| 36 | * Create  | 
            ||
| 37 | * @param array $fields  | 
            ||
| 38 | * @return Invoices  | 
            ||
| 39 | */  | 
            ||
| 40 | public function create(array $fields): Invoices  | 
            ||
| 41 |     { | 
            ||
| 42 |         $this->request('POST', '/invoices', $fields); | 
            ||
| 43 | |||
| 44 | return $this;  | 
            ||
| 45 | }  | 
            ||
| 46 | |||
| 47 | /**  | 
            ||
| 48 | * Read  | 
            ||
| 49 | * @param int $invoice_id  | 
            ||
| 50 | * @return Invoices  | 
            ||
| 51 | */  | 
            ||
| 52 | public function read(int $invoice_id): Invoices  | 
            ||
| 53 |     { | 
            ||
| 54 |         $this->request('GET', "/invoices/{$invoice_id}"); | 
            ||
| 55 | |||
| 56 | return $this;  | 
            ||
| 57 | }  | 
            ||
| 58 | |||
| 59 | /**  | 
            ||
| 60 | * Update  | 
            ||
| 61 | * @param int $invoice_id  | 
            ||
| 62 | * @param array $fields  | 
            ||
| 63 | * @return Invoices  | 
            ||
| 64 | */  | 
            ||
| 65 | public function update(int $invoice_id, array $fields): Invoices  | 
            ||
| 66 |     { | 
            ||
| 67 |         $this->request('PUT', "/invoices/{$invoice_id}", $fields); | 
            ||
| 68 | |||
| 69 | return $this;  | 
            ||
| 70 | }  | 
            ||
| 71 | |||
| 72 | /**  | 
            ||
| 73 | * Delete  | 
            ||
| 74 | * @param int $invoice_id  | 
            ||
| 75 | * @return Invoices  | 
            ||
| 76 | */  | 
            ||
| 77 | public function delete(int $invoice_id): Invoices  | 
            ||
| 82 | }  | 
            ||
| 83 | }  | 
            ||
| 84 |