@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @author Temitope Olotin <[email protected]> |
|
| 4 | - * @license <https://opensource.org/license/MIT> MIT |
|
| 5 | - */ |
|
| 3 | + * @author Temitope Olotin <[email protected]> |
|
| 4 | + * @license <https://opensource.org/license/MIT> MIT |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
| 8 | 8 | |
@@ -74,6 +74,9 @@ |
||
| 74 | 74 | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @param string $keywords |
|
| 79 | + */ |
|
| 77 | 80 | public function createEmojiKeywords($emoji_id, $keywords) |
| 78 | 81 | { |
| 79 | 82 | if ($keywords) { |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @author Temitope Olotin <[email protected]> |
|
| 4 | - * @license <https://opensource.org/license/MIT> MIT |
|
| 5 | - */ |
|
| 3 | + * @author Temitope Olotin <[email protected]> |
|
| 4 | + * @license <https://opensource.org/license/MIT> MIT |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
| 8 | 8 | |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | * |
| 107 | 107 | * This method creates emoji and keywords associated with it |
| 108 | 108 | * @param $emoji |
| 109 | - * @param $request |
|
| 110 | - * @param $response |
|
| 109 | + * @param Request $request |
|
| 110 | + * @param Response $response |
|
| 111 | 111 | * @param $requestParams |
| 112 | 112 | * |
| 113 | 113 | * @return json response |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | * This method updates an emoji |
| 162 | 162 | * |
| 163 | 163 | * @param $emoji |
| 164 | - * @param $response |
|
| 164 | + * @param Response $response |
|
| 165 | 165 | * @param $updateParams |
| 166 | 166 | * |
| 167 | 167 | * @return json $response |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | if (is_array($requestParams)) { |
| 90 | 90 | if (!$this->checkForDuplicateEmoji($requestParams['name'])) { |
| 91 | 91 | // Validate the user input fields |
| 92 | - $validateResponse = $this->validateUserInput(['name','char','category','keywords',], $requestParams); |
|
| 92 | + $validateResponse = $this->validateUserInput(['name', 'char', 'category', 'keywords', ], $requestParams); |
|
| 93 | 93 | |
| 94 | 94 | if (is_array($validateResponse)) { |
| 95 | 95 | return $response->withJson($validateResponse, 400); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $emoji = Emoji::find($args['id']); |
| 144 | 144 | |
| 145 | 145 | if (count($emoji) > 0) { // Validate the user input fields |
| 146 | - $validateResponse = $this->validateUserInput(['name','char','category',], $upateParams); |
|
| 146 | + $validateResponse = $this->validateUserInput(['name', 'char', 'category', ], $upateParams); |
|
| 147 | 147 | if (is_array($validateResponse)) { |
| 148 | 148 | return $response->withJson($validateResponse, 400); |
| 149 | 149 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | foreach ($emojis as $key => &$value) { |
| 287 | 287 | $value['created_by'] = $value['created_by']['firstname'].' '.$value['created_by']['lastname']; |
| 288 | 288 | $value['category'] = $value['category']['category_name']; |
| 289 | - $value['keywords'] = array_map(function ($key) { return $key['keyword_name']; }, $value['keywords']); |
|
| 289 | + $value['keywords'] = array_map(function($key) { return $key['keyword_name']; }, $value['keywords']); |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | return $emojis; |