@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @param array $credentials |
| 157 | 157 | * @param boolean $skipConfirmEmail |
| 158 | - * @return array |
|
| 158 | + * @return boolean |
|
| 159 | 159 | */ |
| 160 | 160 | public function register($credentials, $skipConfirmEmail = false) |
| 161 | 161 | { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | * Reset the given user's password. |
| 247 | 247 | * |
| 248 | 248 | * @param array $credentials |
| 249 | - * @return array |
|
| 249 | + * @return string|null |
|
| 250 | 250 | */ |
| 251 | 251 | public function resetPassword($credentials) |
| 252 | 252 | { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $user = \Core::users()->find(\Auth::id(), $relations); |
| 29 | 29 | foreach ($user->groups()->get() as $group) |
| 30 | 30 | { |
| 31 | - $group->permissions->each(function ($permission) use (&$permissions){ |
|
| 31 | + $group->permissions->each(function($permission) use (&$permissions){ |
|
| 32 | 32 | $permissions[$permission->model][$permission->id] = $permission->name; |
| 33 | 33 | }); |
| 34 | 34 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $user = $user ?: $this->find(\Auth::id(), ['groups.permissions']); |
| 52 | 52 | $permissions = []; |
| 53 | 53 | |
| 54 | - $user->groups->pluck('permissions')->each(function ($permission) use (&$permissions, $model){ |
|
| 54 | + $user->groups->pluck('permissions')->each(function($permission) use (&$permissions, $model){ |
|
| 55 | 55 | $permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray()); |
| 56 | 56 | }); |
| 57 | 57 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function assignGroups($userId, $groupIds) |
| 82 | 82 | { |
| 83 | - \DB::transaction(function () use ($userId, $groupIds) { |
|
| 83 | + \DB::transaction(function() use ($userId, $groupIds) { |
|
| 84 | 84 | $user = $this->find($userId); |
| 85 | 85 | $user->groups()->detach(); |
| 86 | 86 | $user->groups()->attach($groupIds); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public function resetPassword($credentials) |
| 252 | 252 | { |
| 253 | - $response = \Password::reset($credentials, function ($user, $password) { |
|
| 253 | + $response = \Password::reset($credentials, function($user, $password) { |
|
| 254 | 254 | $user->password = $password; |
| 255 | 255 | $user->save(); |
| 256 | 256 | }); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @param array $relations |
| 34 | 34 | * @param string $sortBy |
| 35 | - * @param boolean $desc |
|
| 35 | + * @param integer $desc |
|
| 36 | 36 | * @param array $columns |
| 37 | 37 | * @return collection |
| 38 | 38 | */ |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @param integer $perPage |
| 51 | 51 | * @param array $relations |
| 52 | 52 | * @param string $sortBy |
| 53 | - * @param boolean $desc |
|
| 53 | + * @param integer $desc |
|
| 54 | 54 | * @param array $columns |
| 55 | 55 | * @return collection |
| 56 | 56 | */ |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * @param integer $perPage |
| 165 | 165 | * @param array $relations |
| 166 | 166 | * @param string $sortBy |
| 167 | - * @param boolean $desc |
|
| 167 | + * @param integer $desc |
|
| 168 | 168 | * @param array $columns |
| 169 | 169 | * @return collection |
| 170 | 170 | */ |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @param integer $perPage |
| 183 | 183 | * @param array $relations |
| 184 | 184 | * @param string $sortBy |
| 185 | - * @param boolean $desc |
|
| 185 | + * @param integer $desc |
|
| 186 | 186 | * @param array $columns |
| 187 | 187 | * @return collection |
| 188 | 188 | */ |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * Save the given model to the storage. |
| 199 | 199 | * |
| 200 | 200 | * @param array $data |
| 201 | - * @return mixed |
|
| 201 | + * @return boolean |
|
| 202 | 202 | */ |
| 203 | 203 | public function save(array $data) |
| 204 | 204 | { |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | * id. |
| 518 | 518 | * |
| 519 | 519 | * @param integer $id |
| 520 | - * @param array $relations |
|
| 520 | + * @param string[] $relations |
|
| 521 | 521 | * @param array $columns |
| 522 | 522 | * @return object |
| 523 | 523 | */ |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | * @param array $conditions array of conditions |
| 534 | 534 | * @param array $relations |
| 535 | 535 | * @param string $sortBy |
| 536 | - * @param boolean $desc |
|
| 536 | + * @param integer $desc |
|
| 537 | 537 | * @param array $columns |
| 538 | 538 | * @return collection |
| 539 | 539 | */ |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | * @param array $conditions array of conditions |
| 566 | 566 | * @param integer $perPage |
| 567 | 567 | * @param string $sortBy |
| 568 | - * @param boolean $desc |
|
| 568 | + * @param integer $desc |
|
| 569 | 569 | * @param array $columns |
| 570 | 570 | * @return collection |
| 571 | 571 | */ |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * based on the docblock. |
| 125 | 125 | * |
| 126 | 126 | * @param array &$route |
| 127 | - * @param object $reflectionMethod |
|
| 127 | + * @param \ReflectionMethod $reflectionMethod |
|
| 128 | 128 | * @return void |
| 129 | 129 | */ |
| 130 | 130 | protected function processDocBlock(&$route, $reflectionMethod) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * Generate post body for the given route. |
| 149 | 149 | * |
| 150 | 150 | * @param array &$route |
| 151 | - * @param object $reflectionMethod |
|
| 151 | + * @param \ReflectionMethod $reflectionMethod |
|
| 152 | 152 | * @param array $validationRules |
| 153 | 153 | * @return void |
| 154 | 154 | */ |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * Register the given device to the logged in user. |
| 22 | 22 | * |
| 23 | 23 | * @param array $data |
| 24 | - * @return void |
|
| 24 | + * @return boolean |
|
| 25 | 25 | */ |
| 26 | 26 | public function registerDevice($data) |
| 27 | 27 | { |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * to preform actions like (add, edit ... etc). |
| 14 | 14 | * @var string |
| 15 | 15 | */ |
| 16 | - protected $model = 'users'; |
|
| 16 | + protected $model = 'users'; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * List of all route actions that the base api controller |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | * will skip login check for them. |
| 28 | 28 | * @var array |
| 29 | 29 | */ |
| 30 | - protected $skipLoginCheck = ['login', 'loginSocial', 'register', 'sendreset', 'resetpassword', 'refreshtoken', 'confirmEmail', 'resendEmailConfirmation']; |
|
| 30 | + protected $skipLoginCheck = ['login', 'loginSocial', 'register', 'sendreset', 'resetpassword', 'refreshtoken', 'confirmEmail', 'resendEmailConfirmation']; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * The validations rules used by the base api controller |
| 34 | 34 | * to check before add. |
| 35 | 35 | * @var array |
| 36 | 36 | */ |
| 37 | - protected $validationRules = [ |
|
| 37 | + protected $validationRules = [ |
|
| 38 | 38 | 'name' => 'nullable|string', |
| 39 | 39 | 'email' => 'required|email|unique:users,email,{id}', |
| 40 | 40 | 'password' => 'nullable|min:6' |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $this->validate($request, [ |
| 282 | 282 | 'profile_picture' => 'nullable|string', |
| 283 | 283 | 'name' => 'nullable|string', |
| 284 | - 'email' => 'required|email|unique:users,email,' . \Auth::id() |
|
| 284 | + 'email' => 'required|email|unique:users,email,'.\Auth::id() |
|
| 285 | 285 | ]); |
| 286 | 286 | |
| 287 | 287 | return \Response::json($this->repo->saveProfile($request->only('name', 'email', 'profile_picture')), 200); |
@@ -11,13 +11,13 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function uploadImage($image, $dir) |
| 13 | 13 | { |
| 14 | - $imageName = str_slug('image' . uniqid() . time() . '_' . $image->getClientOriginalName()); |
|
| 15 | - $destinationPath = 'media' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR; |
|
| 14 | + $imageName = str_slug('image'.uniqid().time().'_'.$image->getClientOriginalName()); |
|
| 15 | + $destinationPath = 'media'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR; |
|
| 16 | 16 | |
| 17 | 17 | ! file_exists($destinationPath) ? \File::makeDirectory($destinationPath) : false; |
| 18 | 18 | $image->move($destinationPath, $imageName); |
| 19 | 19 | |
| 20 | - return url($destinationPath . $imageName); |
|
| 20 | + return url($destinationPath.$imageName); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -29,20 +29,20 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function uploadImageBas64($image, $dir) |
| 31 | 31 | { |
| 32 | - if (! strlen($image)) |
|
| 32 | + if ( ! strlen($image)) |
|
| 33 | 33 | { |
| 34 | 34 | return null; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - $imageName = 'image' . uniqid() . time() . '.jpg'; |
|
| 38 | - $destinationPath = 'media' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR; |
|
| 37 | + $imageName = 'image'.uniqid().time().'.jpg'; |
|
| 38 | + $destinationPath = 'media'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR; |
|
| 39 | 39 | |
| 40 | 40 | ! file_exists($destinationPath) ? \File::makeDirectory($destinationPath) : false; |
| 41 | 41 | |
| 42 | - $base = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $image)); |
|
| 43 | - \Image::make($base)->save($destinationPath . $imageName); |
|
| 42 | + $base = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $image)); |
|
| 43 | + \Image::make($base)->save($destinationPath.$imageName); |
|
| 44 | 44 | |
| 45 | - return url($destinationPath . $imageName); |
|
| 45 | + return url($destinationPath.$imageName); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function deleteImage($path, $dir) |
| 56 | 56 | { |
| 57 | 57 | $arr = explode('/', $path); |
| 58 | - $path = 'media' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . end($arr); |
|
| 58 | + $path = 'media'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.end($arr); |
|
| 59 | 59 | if (\File::exists($path)) |
| 60 | 60 | { |
| 61 | 61 | \File::delete($path); |