@@ -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); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $emoji = Emoji::find($args['id']); |
| 145 | 145 | |
| 146 | 146 | if (count($emoji) > 0) { // Validate the user input fields |
| 147 | - $validateResponse = $this->validateUserInput(['name','char','category',], $updateParams); |
|
| 147 | + $validateResponse = $this->validateUserInput(['name', 'char', 'category', ], $updateParams); |
|
| 148 | 148 | if (is_array($validateResponse)) { |
| 149 | 149 | return $response->withJson($validateResponse, 400); |
| 150 | 150 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | foreach ($emojis as $key => &$value) { |
| 288 | 288 | $value['created_by'] = $value['created_by']['firstname'].' '.$value['created_by']['lastname']; |
| 289 | 289 | $value['category'] = $value['category']['category_name']; |
| 290 | - $value['keywords'] = array_map(function ($key) { return $key['keyword_name']; }, $value['keywords']); |
|
| 290 | + $value['keywords'] = array_map(function($key) { return $key['keyword_name']; }, $value['keywords']); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | return $emojis; |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | * Create the token params as an array |
| 148 | 148 | */ |
| 149 | 149 | $data = [ |
| 150 | - 'iat' => $issuedAt, // Issued at: time when the token was generated |
|
| 151 | - 'jti' => $tokenId, // Json Token Id: an unique identifier for the token |
|
| 152 | - 'iss' => $serverName, // Issuer |
|
| 153 | - 'nbf' => $notBefore, // Not before |
|
| 154 | - 'exp' => $expire, // Expire |
|
| 155 | - 'dat' => $userData, // User Information retrieved from the database |
|
| 150 | + 'iat' => $issuedAt, // Issued at: time when the token was generated |
|
| 151 | + 'jti' => $tokenId, // Json Token Id: an unique identifier for the token |
|
| 152 | + 'iss' => $serverName, // Issuer |
|
| 153 | + 'nbf' => $notBefore, // Not before |
|
| 154 | + 'exp' => $expire, // Expire |
|
| 155 | + 'dat' => $userData, // User Information retrieved from the database |
|
| 156 | 156 | ]; |
| 157 | 157 | |
| 158 | 158 | $loadEnv = DatabaseConnection::loadEnv(); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $secretKey = base64_decode(getenv('secret')); |
| 161 | 161 | |
| 162 | 162 | $jwt = JWT::encode( |
| 163 | - $data, //Data to be encoded in the JWT |
|
| 163 | + $data, //Data to be encoded in the JWT |
|
| 164 | 164 | $secretKey, // The signing key |
| 165 | 165 | 'HS512' // Algorithm used to sign the token |
| 166 | 166 | ); |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * This method creates user |
| 53 | 53 | * |
| 54 | - * @param $user |
|
| 54 | + * @param UserController $user |
|
| 55 | 55 | * @param $userParams |
| 56 | - * @param $response |
|
| 56 | + * @param Response $response |
|
| 57 | 57 | * |
| 58 | 58 | * @return json $response |
| 59 | 59 | */ |
@@ -80,7 +80,6 @@ discard block |
||
| 80 | 80 | * This method authenticate the user and log them in if the supplied |
| 81 | 81 | * credentials are valid. |
| 82 | 82 | * |
| 83 | - * @param array $loginParams |
|
| 84 | 83 | * |
| 85 | 84 | * @return json jwt |
| 86 | 85 | */ |