| Total Complexity | 5 |
| Total Lines | 87 |
| Duplicated Lines | 0 % |
| Coverage | 80.95% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class Items extends Client |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $namespace = __CLASS__; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Retrieve a item |
||
| 16 | * Retrieves the details of a item. Provide the unique id for the item. |
||
| 17 | * |
||
| 18 | * @param int $item_id The item id |
||
| 19 | * |
||
| 20 | * @return $this |
||
| 21 | */ |
||
| 22 | 1 | public function __invoke(int $item_id): self |
|
| 23 | { |
||
| 24 | 1 | $this->item_id = $item_id; |
|
|
|
|||
| 25 | |||
| 26 | // Set HTTP params |
||
| 27 | 1 | $this->type = 'get'; |
|
| 28 | 1 | $this->endpoint = '/items/' . $item_id; |
|
| 29 | |||
| 30 | 1 | return $this; |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * List all items |
||
| 35 | * Returns a list of your items. The items are returned sorted by creation date, with the most recent item appearing first. |
||
| 36 | * |
||
| 37 | * @return $this |
||
| 38 | */ |
||
| 39 | public function all(): self |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * List all item booking questions |
||
| 50 | * Returns a list of your item booking questions. |
||
| 51 | * The items are returned sorted by creation date, with the most recent item appearing first. |
||
| 52 | * |
||
| 53 | * @return $this |
||
| 54 | */ |
||
| 55 | 1 | public function booking_questions(): self |
|
| 56 | { |
||
| 57 | // Set HTTP params |
||
| 58 | 1 | $this->type = 'get'; |
|
| 59 | 1 | $this->endpoint = '/items/' . $this->item_id . '/booking_questions'; |
|
| 60 | |||
| 61 | 1 | return $this; |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * List all item reviews |
||
| 66 | * Returns a list of your item reviews. |
||
| 67 | * The items are returned sorted by creation date, with the most recent item appearing first. |
||
| 68 | * |
||
| 69 | * @return $this |
||
| 70 | */ |
||
| 71 | 1 | public function reviews(): self |
|
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * List all item extras |
||
| 82 | * Returns a list of your item extras. |
||
| 83 | * The items are returned sorted by creation date, with the most recent item appearing first. |
||
| 84 | * |
||
| 85 | * @return $this |
||
| 86 | */ |
||
| 87 | 1 | public function extras(): self |
|
| 94 | } |
||
| 95 | } |
||
| 96 |