Skip to content
This repository was archived by the owner on Dec 18, 2022. It is now read-only.

Commit cdbc18a

Browse files
garakStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 4db7248 commit cdbc18a

12 files changed

+34
-16
lines changed

Command/PromoteUserCommand.php

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Beelab\UserBundle\Command;
44

5-
use Beelab\UserBundle\Manager\LightUserManagerInterface;
65
use Beelab\UserBundle\Manager\UserManagerInterface;
76
use Symfony\Component\Console\Input\InputArgument;
87
use Symfony\Component\Console\Input\InputInterface;

Controller/AuthController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function loginCheckAction(): void
6565
* Get possible authentication error.
6666
*
6767
* @param LoggerInterface $logger
68-
* @param Request $request
68+
* @param Request $request
6969
*
7070
* @return \Exception|null
7171
*/

Controller/UserController.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function newAction(UserManagerInterface $manager, Request $request): Resp
7979
return $this->redirectToRoute('user_show', ['id' => $user->getId()]);
8080
}
8181

82-
return $this->render('BeelabUserBundle:User:new.html.twig',[
82+
return $this->render('BeelabUserBundle:User:new.html.twig', [
8383
'user' => $user,
8484
'form' => $form->createView(),
8585
]);
@@ -102,7 +102,7 @@ public function editAction($id, UserManagerInterface $manager, Request $request)
102102
}
103103
$deleteForm = $this->createDeleteForm($user->getId());
104104

105-
return $this->render('BeelabUserBundle:User:edit.html.twig',[
105+
return $this->render('BeelabUserBundle:User:edit.html.twig', [
106106
'user' => $user,
107107
'edit_form' => $editForm->createView(),
108108
'delete_form' => $deleteForm->createView(),

Entity/User.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public static function getRoleLabels(): array
422422
*/
423423
public function getRoleLabel($role): string
424424
{
425-
return $role == 'ROLE_SUPER_ADMIN' ? 'super admin' : static::$roleLabels[$role];
425+
return 'ROLE_SUPER_ADMIN' == $role ? 'super admin' : static::$roleLabels[$role];
426426
}
427427

428428
/**

Manager/UserManagerInterface.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
interface UserManagerInterface extends LightUserManagerInterface
1010
{
11-
/**
12-
* List of users (can be paginated).
13-
*
14-
* @param int $page
15-
* @param int $limit
16-
* @param string $sortBy
17-
*
18-
* @return mixed \Knp\Component\Pager\Pagination\PaginationInterface or array
19-
*/
11+
/**
12+
* List of users (can be paginated).
13+
*
14+
* @param int $page
15+
* @param int $limit
16+
* @param string $sortBy
17+
*
18+
* @return mixed \Knp\Component\Pager\Pagination\PaginationInterface or array
19+
*/
2020
public function getList(int $page = 1, int $limit = 20, string $sortBy = 'email');
2121

2222
/**

Repository/UserRepository.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function supportsClass($class): bool
5656
*/
5757
public function filterByRole(string $role): QueryBuilder
5858
{
59-
$role = $role === 'ROLE_USER' ? '{}' : '"'.$role.'"';
59+
$role = 'ROLE_USER' === $role ? '{}' : '"'.$role.'"';
6060

6161
return $this
6262
->createQueryBuilder('u')
@@ -69,7 +69,7 @@ public function filterByRoles(array $roles): QueryBuilder
6969
{
7070
$qb = $this->createQueryBuilder('u');
7171
foreach ($roles as $key => $role) {
72-
$role = $role === 'ROLE_USER' ? '{}' : '"'.$role.'"';
72+
$role = 'ROLE_USER' === $role ? '{}' : '"'.$role.'"';
7373
$qb->orWhere('u.roles LIKE :role'.$key)->setParameter('role'.$key, '%'.$role.'%');
7474
}
7575

Tests/Controller/UserControllerTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@
2323
class UserControllerTest extends TestCase
2424
{
2525
protected $controller;
26+
2627
protected $container;
28+
2729
protected $formBuilder;
30+
2831
protected $userManager;
32+
2933
protected $router;
3034

3135
protected function setUp(): void

Tests/Listener/LastLoginListenerTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
class LastLoginListenerTest extends TestCase
1515
{
1616
protected $listener;
17+
1718
protected $userManager;
1819

1920
protected function setUp(): void

Tests/Manager/LightUserManagerTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
class LightUserManagerTest extends TestCase
1515
{
1616
protected $manager;
17+
1718
protected $em;
19+
1820
protected $repository;
21+
1922
protected $encoder;
2023

2124
protected function setUp(): void

Tests/Manager/UserManagerTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@
1515
class UserManagerTest extends TestCase
1616
{
1717
protected $manager;
18+
1819
protected $em;
20+
1921
protected $repository;
22+
2023
protected $encoder;
24+
2125
protected $authChecker;
26+
2227
protected $tokenStorage;
28+
2329
protected $paginator;
30+
2431
protected $dispatcher;
2532

2633
protected function setUp(): void

Tests/Repository/UserRepositoryTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
class UserRepositoryTest extends TestCase
1717
{
1818
protected $repository;
19+
1920
protected $em;
21+
2022
protected $class;
2123

2224
protected function setUp(): void

Twig/BeelabUserTwigExtension.php

+2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
class BeelabUserTwigExtension extends Twig_Extension implements Twig_Extension_GlobalsInterface
1515
{
1616
protected $layout;
17+
1718
protected $route;
19+
1820
protected $hasPaginator = false;
1921

2022
/**

0 commit comments

Comments
 (0)