@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function run($userId = null) |
| 45 | 45 | { |
| 46 | - if(!$userId){ |
|
| 46 | + if (!$userId) { |
|
| 47 | 47 | $userId = $this->getAuthenticatedUserTask->run()->id; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -33,10 +33,10 @@ |
||
| 33 | 33 | 'name' => $data['name'], |
| 34 | 34 | ], $response); |
| 35 | 35 | |
| 36 | - // assert response contain the token |
|
| 36 | + // assert response contain the token |
|
| 37 | 37 | $this->assertResponseContainKeys(['id', 'token'], $response); |
| 38 | 38 | |
| 39 | - // assert the data is stored in the database |
|
| 39 | + // assert the data is stored in the database |
|
| 40 | 40 | $this->seeInDatabase('users', ['email' => $data['email']]); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -36,10 +36,10 @@ |
||
| 36 | 36 | 'name' => $data['name'], |
| 37 | 37 | ], $response); |
| 38 | 38 | |
| 39 | - // assert response contain the token |
|
| 39 | + // assert response contain the token |
|
| 40 | 40 | $this->assertResponseContainKeys(['id', 'token'], $response); |
| 41 | 41 | |
| 42 | - // assert the data is stored in the database |
|
| 42 | + // assert the data is stored in the database |
|
| 43 | 43 | $this->seeInDatabase('users', ['email' => $data['email']]); |
| 44 | 44 | |
| 45 | 45 | $responseObject = $this->getResponseObject($response); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function runEndpointsHashedIdsDecoder() |
| 30 | 30 | { |
| 31 | 31 | if (Config::get('hello.hash-id')) { |
| 32 | - Route::bind('id', function ($id, $route) { |
|
| 32 | + Route::bind('id', function($id, $route) { |
|
| 33 | 33 | // skip decoding some endpoints |
| 34 | 34 | if (!in_array($route->getUri(), $this->skippedEndpoints)) { |
| 35 | 35 | |
@@ -61,13 +61,13 @@ |
||
| 61 | 61 | return $id; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Will be used by the Eloquent Models (since it's used as trait there). |
|
| 66 | - * |
|
| 67 | - * @param null $key |
|
| 68 | - * |
|
| 69 | - * @return mixed |
|
| 70 | - */ |
|
| 64 | + /** |
|
| 65 | + * Will be used by the Eloquent Models (since it's used as trait there). |
|
| 66 | + * |
|
| 67 | + * @param null $key |
|
| 68 | + * |
|
| 69 | + * @return mixed |
|
| 70 | + */ |
|
| 71 | 71 | public function getHashedKey($key = null) |
| 72 | 72 | { |
| 73 | 73 | // hash the ID only if hash-id enabled in the config |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function runQueryDebugger($log = true, $terminal = false) |
| 26 | 26 | { |
| 27 | 27 | if (Config::get('database.query_debugging')) { |
| 28 | - DB::listen(function ($event) use ($terminal, $log) { |
|
| 28 | + DB::listen(function($event) use ($terminal, $log) { |
|
| 29 | 29 | $fullQuery = vsprintf(str_replace(['%', '?'], ['%%', '%s'], $event->sql), $event->bindings); |
| 30 | 30 | |
| 31 | 31 | $text = $event->connectionName . ' (' . $event->time . '): ' . $fullQuery; |
@@ -13,16 +13,16 @@ |
||
| 13 | 13 | class AdminsCriteria extends Criteria |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @param $model |
|
| 18 | - * @param \Prettus\Repository\Contracts\RepositoryInterface $repository |
|
| 19 | - * |
|
| 20 | - * @return mixed |
|
| 21 | - */ |
|
| 22 | - public function apply($model, PrettusRepositoryInterface $repository) |
|
| 23 | - { |
|
| 16 | + /** |
|
| 17 | + * @param $model |
|
| 18 | + * @param \Prettus\Repository\Contracts\RepositoryInterface $repository |
|
| 19 | + * |
|
| 20 | + * @return mixed |
|
| 21 | + */ |
|
| 22 | + public function apply($model, PrettusRepositoryInterface $repository) |
|
| 23 | + { |
|
| 24 | 24 | return $model->whereHas('roles', function ($q) { |
| 25 | - $q->where('name', 'admin'); |
|
| 25 | + $q->where('name', 'admin'); |
|
| 26 | 26 | }); |
| 27 | - } |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function apply($model, PrettusRepositoryInterface $repository) |
| 23 | 23 | { |
| 24 | - return $model->whereHas('roles', function ($q) { |
|
| 24 | + return $model->whereHas('roles', function($q) { |
|
| 25 | 25 | $q->where('name', 'admin'); |
| 26 | 26 | }); |
| 27 | 27 | } |
@@ -54,12 +54,12 @@ |
||
| 54 | 54 | return $this->response->paginator($users, new UserTransformer()); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * @param \App\Containers\User\UI\API\Requests\ListAllUsersRequest $request |
|
| 59 | - * @param \App\Containers\User\Actions\ListAndSearchUsersAction $action |
|
| 60 | - * |
|
| 61 | - * @return \Dingo\Api\Http\Response |
|
| 62 | - */ |
|
| 57 | + /** |
|
| 58 | + * @param \App\Containers\User\UI\API\Requests\ListAllUsersRequest $request |
|
| 59 | + * @param \App\Containers\User\Actions\ListAndSearchUsersAction $action |
|
| 60 | + * |
|
| 61 | + * @return \Dingo\Api\Http\Response |
|
| 62 | + */ |
|
| 63 | 63 | public function listAllAdmins(ListAllUsersRequest $request, ListAndSearchUsersAction $action) |
| 64 | 64 | { |
| 65 | 65 | $users = $action->run(true, true); |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use App\Containers\Authorization\Models\Permission; |
| 6 | 6 | use App\Containers\Authorization\Models\Role; |
| 7 | -use App\Containers\User\Models\User; |
|
| 8 | 7 | use App\Port\Test\PHPUnit\Abstracts\TestCase; |
| 9 | 8 | |
| 10 | 9 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public $loggedInTestingUser; |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * @param $endpoint |
|
| 40 | + * @param string $endpoint |
|
| 41 | 41 | * @param string $verb |
| 42 | 42 | * @param array $data |
| 43 | 43 | * @param bool $protected |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | - * @return App\Containers\User\Models\User|mixed |
|
| 136 | + * @return User |
|
| 137 | 137 | */ |
| 138 | 138 | public function getLoggedInTestingAdmin() |
| 139 | 139 | { |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | /** |
| 172 | 172 | * @param null $userDetails |
| 173 | 173 | * |
| 174 | - * @return mixed |
|
| 174 | + * @return User |
|
| 175 | 175 | */ |
| 176 | 176 | public function registerAndLoginTestingUser($userDetails = null) |
| 177 | 177 | { |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | /** |
| 203 | 203 | * @param null $userDetails |
| 204 | 204 | * |
| 205 | - * @return mixed |
|
| 205 | + * @return User |
|
| 206 | 206 | */ |
| 207 | 207 | public function registerAndLoginTestingAdmin($userDetails = null) |
| 208 | 208 | { |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | * |
| 219 | 219 | * @param null $userDetails |
| 220 | 220 | * |
| 221 | - * @return mixed |
|
| 221 | + * @return User |
|
| 222 | 222 | */ |
| 223 | 223 | public function registerAndLoginTestingDeveloper($userDetails = null) |
| 224 | 224 | { |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | - * @param $keys |
|
| 236 | + * @param string[] $keys |
|
| 237 | 237 | * @param $response |
| 238 | 238 | */ |
| 239 | 239 | public function assertResponseContainKeys($keys, $response) |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | ); |
| 197 | 197 | |
| 198 | 198 | // if permission property is defined than attach permission on the user |
| 199 | - if(isset($this->permissions)){ |
|
| 199 | + if (isset($this->permissions)) { |
|
| 200 | 200 | $user->givePermissionTo($this->permissions); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | public function overrideSubDomain($subDomain, $url = null) |
| 394 | 394 | { |
| 395 | - $url = ($url) ? : $this->baseUrl; |
|
| 395 | + $url = ($url) ?: $this->baseUrl; |
|
| 396 | 396 | |
| 397 | 397 | $info = parse_url($url); |
| 398 | 398 | |