ReviewOS

also looking at this

meemalabs/meema-client-php

WIP: Upload Endpoint

#38
Merged glennmichael123 wants to merge upload-endpoint into main
6 files +172 -94
src/Models/Tag.phpmodified+14-11
Changes to src/Models/Tag.php
@@ -46,21 +46,21 @@ class Tag
4646 /**
4747 * Get specific tags.
4848 *
49 * @param int $id
49 * @param array $ids
5050 *
5151 * @return array
5252 */
53 public function get($id = null): array
53 public function get($ids = null): array
5454 {
5555 if ($this->model) {
5656 return $this->fetchForModel();
5757 }
5858
59 if (! $id) {
59 if (! $ids) {
6060 return $this->all();
6161 }
6262
63 $ids = is_array($id) ? $id : func_get_args();
63 $ids = is_array($ids) ? $ids : func_get_args();
6464
6565 foreach ($ids as $id) {
6666 if (! is_int($id)) {
@@ -90,10 +90,10 @@ class Tag
9090 }
9191
9292 /**
93 * Update folder.
93 * Update a tag color.
9494 *
95 * @param string $name
9695 * @param int $id
96 * @param string $color
9797 *
9898 * @return array
9999 */
@@ -106,22 +106,21 @@ class Tag
106106 $data = [
107107 'color' => $color,
108108 'tag_id' => $id,
109 'team_id' => 1,
110109 ];
111110
112111 return $this->client->request('PATCH', 'tags/color', $data);
113112 }
114113
115114 /**
116 * Delete a folder.
115 * Delete tags.
117116 *
118 * @param int $id
117 * @param array $ids
119118 *
120119 * @return Response
121120 */
122 public function delete($id)
121 public function delete($ids)
123122 {
124 $ids = is_array($id) ? $id : func_get_args();
123 $ids = is_array($ids) ? $ids : func_get_args();
125124
126125 foreach ($ids as $id) {
127126 if (! is_int($id)) {
@@ -142,6 +141,8 @@ class Tag
142141 /**
143142 * Initialize the media model.
144143 *
144 * @param int $id
145 *
145146 * @return Meema\MeemaApi\Models\Media
146147 */
147148 public function media($id = null): Media
@@ -154,6 +155,8 @@ class Tag
154155 /**
155156 * Initialize the folder model.
156157 *
158 * @param int $id
159 *
157160 * @return Meema\MeemaApi\Models\Folder
158161 */
159162 public function folders($id = null): Folder