| Total Complexity | 3 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | class Customers extends Client |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | protected $namespace = __CLASS__; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Create a customer |
||
| 17 | * Creates a new customer object. |
||
| 18 | * |
||
| 19 | * @param Customer $customer |
||
| 20 | * |
||
| 21 | * @return $this |
||
| 22 | */ |
||
| 23 | 1 | public function create(Customer $customer): self |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Retrieve a customer |
||
| 42 | * Retrieves the details of a customer. Provide the unique id for the customer. |
||
| 43 | * |
||
| 44 | * @param int $customer_id The customer id |
||
| 45 | * |
||
| 46 | * @return $this |
||
| 47 | */ |
||
| 48 | 1 | public function __invoke(int $customer_id): self |
|
| 49 | { |
||
| 50 | 1 | $this->customer_id = $customer_id; |
|
| 51 | |||
| 52 | // Set HTTP params |
||
| 53 | 1 | $this->type = 'get'; |
|
| 54 | 1 | $this->endpoint = '/customers/' . $customer_id; |
|
| 55 | 1 | $this->response = Customer::class; |
|
| 56 | |||
| 57 | 1 | return $this; |
|
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Create a customer |
||
| 62 | * Creates a new customer object. |
||
| 63 | * |
||
| 64 | * @param Customer $customer |
||
| 65 | * |
||
| 66 | * @return $this |
||
| 67 | */ |
||
| 68 | 1 | public function update(Customer $customer): self |
|
| 77 | } |
||
| 78 | } |
||
| 79 |