@@ -10,8 +10,7 @@ discard block |
||
10 | 10 | * @ORM\Table(name="user_logs", indexes={@ORM\Index(name="fk_user_infos_user_idx", columns={"user_id"})}) |
11 | 11 | * @ORM\Entity |
12 | 12 | */ |
13 | -class UserLogs |
|
14 | -{ |
|
13 | +class UserLogs { |
|
15 | 14 | /** |
16 | 15 | * @var integer |
17 | 16 | * |
@@ -36,32 +35,28 @@ discard block |
||
36 | 35 | /** |
37 | 36 | * @return int |
38 | 37 | */ |
39 | - public function getId() |
|
40 | - { |
|
38 | + public function getId() { |
|
41 | 39 | return $this->id; |
42 | 40 | } |
43 | 41 | |
44 | 42 | /** |
45 | 43 | * @param int $id |
46 | 44 | */ |
47 | - public function setId($id) |
|
48 | - { |
|
45 | + public function setId($id) { |
|
49 | 46 | $this->id = $id; |
50 | 47 | } |
51 | 48 | |
52 | 49 | /** |
53 | 50 | * @return \User |
54 | 51 | */ |
55 | - public function getUser() |
|
56 | - { |
|
52 | + public function getUser() { |
|
57 | 53 | return $this->user; |
58 | 54 | } |
59 | 55 | |
60 | 56 | /** |
61 | 57 | * @param \User $user |
62 | 58 | */ |
63 | - public function setUser($user) |
|
64 | - { |
|
59 | + public function setUser($user) { |
|
65 | 60 | $this->user = $user; |
66 | 61 | } |
67 | 62 |
@@ -12,58 +12,58 @@ |
||
12 | 12 | */ |
13 | 13 | class UserLogs |
14 | 14 | { |
15 | - /** |
|
16 | - * @var integer |
|
17 | - * |
|
18 | - * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
19 | - * @ORM\Id |
|
20 | - * @ORM\GeneratedValue(strategy="NONE") |
|
21 | - */ |
|
22 | - private $id; |
|
15 | + /** |
|
16 | + * @var integer |
|
17 | + * |
|
18 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
19 | + * @ORM\Id |
|
20 | + * @ORM\GeneratedValue(strategy="NONE") |
|
21 | + */ |
|
22 | + private $id; |
|
23 | 23 | |
24 | - /** |
|
25 | - * @var \User |
|
26 | - * |
|
27 | - * @ORM\Id |
|
28 | - * @ORM\GeneratedValue(strategy="NONE") |
|
29 | - * @ORM\OneToOne(targetEntity="User") |
|
30 | - * @ORM\JoinColumns({ |
|
31 | - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") |
|
32 | - * }) |
|
33 | - */ |
|
34 | - private $user; |
|
24 | + /** |
|
25 | + * @var \User |
|
26 | + * |
|
27 | + * @ORM\Id |
|
28 | + * @ORM\GeneratedValue(strategy="NONE") |
|
29 | + * @ORM\OneToOne(targetEntity="User") |
|
30 | + * @ORM\JoinColumns({ |
|
31 | + * @ORM\JoinColumn(name="user_id", referencedColumnName="id") |
|
32 | + * }) |
|
33 | + */ |
|
34 | + private $user; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @return int |
|
38 | - */ |
|
39 | - public function getId() |
|
40 | - { |
|
41 | - return $this->id; |
|
42 | - } |
|
36 | + /** |
|
37 | + * @return int |
|
38 | + */ |
|
39 | + public function getId() |
|
40 | + { |
|
41 | + return $this->id; |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @param int $id |
|
46 | - */ |
|
47 | - public function setId($id) |
|
48 | - { |
|
49 | - $this->id = $id; |
|
50 | - } |
|
44 | + /** |
|
45 | + * @param int $id |
|
46 | + */ |
|
47 | + public function setId($id) |
|
48 | + { |
|
49 | + $this->id = $id; |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return \User |
|
54 | - */ |
|
55 | - public function getUser() |
|
56 | - { |
|
57 | - return $this->user; |
|
58 | - } |
|
52 | + /** |
|
53 | + * @return \User |
|
54 | + */ |
|
55 | + public function getUser() |
|
56 | + { |
|
57 | + return $this->user; |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @param \User $user |
|
62 | - */ |
|
63 | - public function setUser($user) |
|
64 | - { |
|
65 | - $this->user = $user; |
|
66 | - } |
|
60 | + /** |
|
61 | + * @param \User $user |
|
62 | + */ |
|
63 | + public function setUser($user) |
|
64 | + { |
|
65 | + $this->user = $user; |
|
66 | + } |
|
67 | 67 | |
68 | 68 | |
69 | 69 | } |
@@ -6,12 +6,12 @@ |
||
6 | 6 | |
7 | 7 | class DefaultControllerTest extends WebTestCase |
8 | 8 | { |
9 | - public function testIndex() |
|
10 | - { |
|
11 | - $client = static::createClient(); |
|
9 | + public function testIndex() |
|
10 | + { |
|
11 | + $client = static::createClient(); |
|
12 | 12 | |
13 | - $crawler = $client->request('GET', '/'); |
|
13 | + $crawler = $client->request('GET', '/'); |
|
14 | 14 | |
15 | - $this->assertContains('Hello World', $client->getResponse()->getContent()); |
|
16 | - } |
|
15 | + $this->assertContains('Hello World', $client->getResponse()->getContent()); |
|
16 | + } |
|
17 | 17 | } |
@@ -4,10 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Symfony\Bundle\RibsAdminBundle\Test\WebTestCase; |
6 | 6 | |
7 | -class DefaultControllerTest extends WebTestCase |
|
8 | -{ |
|
9 | - public function testIndex() |
|
10 | - { |
|
7 | +class DefaultControllerTest extends WebTestCase { |
|
8 | + public function testIndex() { |
|
11 | 9 | $client = static::createClient(); |
12 | 10 | |
13 | 11 | $crawler = $client->request('GET', '/'); |
@@ -4,10 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
6 | 6 | |
7 | -class RibsAdminBundle extends Bundle |
|
8 | -{ |
|
9 | - public function getParent() |
|
10 | - { |
|
7 | +class RibsAdminBundle extends Bundle { |
|
8 | + public function getParent() { |
|
11 | 9 | return 'FOSUserBundle'; |
12 | 10 | } |
13 | 11 | } |
@@ -9,15 +9,13 @@ discard block |
||
9 | 9 | use Symfony\Component\Security\Core\Exception\AuthenticationException; |
10 | 10 | use Symfony\Component\Security\Core\Security; |
11 | 11 | |
12 | -class LoginController extends FOSController |
|
13 | -{ |
|
12 | +class LoginController extends FOSController { |
|
14 | 13 | /** |
15 | 14 | * @param Request $request |
16 | 15 | * |
17 | 16 | * @return Response |
18 | 17 | */ |
19 | - public function loginAction(Request $request) |
|
20 | - { |
|
18 | + public function loginAction(Request $request) { |
|
21 | 19 | /** @var $session \Symfony\Component\HttpFoundation\Session\Session */ |
22 | 20 | $session = $request->getSession(); |
23 | 21 | |
@@ -27,10 +25,12 @@ discard block |
||
27 | 25 | // get the error if any (works with forward and redirect -- see below) |
28 | 26 | if ($request->attributes->has($authErrorKey)) { |
29 | 27 | $error = $request->attributes->get($authErrorKey); |
30 | - } else if (null !== $session && $session->has($authErrorKey)) { |
|
28 | + } |
|
29 | + else if (null !== $session && $session->has($authErrorKey)) { |
|
31 | 30 | $error = $session->get($authErrorKey); |
32 | 31 | $session->remove($authErrorKey); |
33 | - } else { |
|
32 | + } |
|
33 | + else { |
|
34 | 34 | $error = null; |
35 | 35 | } |
36 | 36 | |
@@ -74,13 +74,11 @@ discard block |
||
74 | 74 | return $this->render("@RibsAdmin/login/login.html.twig", $data); |
75 | 75 | } |
76 | 76 | |
77 | - public function checkAction() |
|
78 | - { |
|
77 | + public function checkAction() { |
|
79 | 78 | throw new \RuntimeException('You must configure the check path to be handled by the firewall using form_login in your security firewall configuration.'); |
80 | 79 | } |
81 | 80 | |
82 | - public function logoutAction() |
|
83 | - { |
|
81 | + public function logoutAction() { |
|
84 | 82 | throw new \RuntimeException('You must activate the logout in your security firewall configuration.'); |
85 | 83 | } |
86 | 84 | } |
@@ -5,8 +5,7 @@ |
||
5 | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
6 | 6 | use Symfony\Component\HttpFoundation\Response; |
7 | 7 | |
8 | -class NavigationBuilderController extends Controller |
|
9 | -{ |
|
8 | +class NavigationBuilderController extends Controller { |
|
10 | 9 | /** |
11 | 10 | * @return Response function that display the left navigation mapped by user rights |
12 | 11 | */ |
@@ -8,8 +8,7 @@ discard block |
||
8 | 8 | use Symfony\Component\Routing\RouterInterface; |
9 | 9 | use Symfony\Component\Security\Core\Exception\AccessDeniedException; |
10 | 10 | |
11 | -class AccessRights |
|
12 | -{ |
|
11 | +class AccessRights { |
|
13 | 12 | private $em; |
14 | 13 | private $router; |
15 | 14 | private $session; |
@@ -22,16 +21,14 @@ discard block |
||
22 | 21 | * @param Session $session |
23 | 22 | * @param RequestStack $request |
24 | 23 | */ |
25 | - public function __construct(ContainerInterface $em, RouterInterface $router, Session $session, RequestStack $request) |
|
26 | - { |
|
24 | + public function __construct(ContainerInterface $em, RouterInterface $router, Session $session, RequestStack $request) { |
|
27 | 25 | $this->em = $em; |
28 | 26 | $this->router = $router; |
29 | 27 | $this->session = $session; |
30 | 28 | $this->request = $request; |
31 | 29 | } |
32 | 30 | |
33 | - public function onKernelController() |
|
34 | - { |
|
31 | + public function onKernelController() { |
|
35 | 32 | $route = $this->request->getCurrentRequest()->get("_route"); |
36 | 33 | $admin_page = explode("_", $route)[0]; |
37 | 34 | |
@@ -72,8 +69,7 @@ discard block |
||
72 | 69 | * @return bool|mixed |
73 | 70 | * fonction that search if the right contain an url or more |
74 | 71 | */ |
75 | - private function in_array_recursive($needle, $haystack) |
|
76 | - { |
|
72 | + private function in_array_recursive($needle, $haystack) { |
|
77 | 73 | $rights = []; |
78 | 74 | $it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($haystack)); |
79 | 75 |
@@ -14,15 +14,15 @@ |
||
14 | 14 | */ |
15 | 15 | class RibsAdminExtension extends Extension |
16 | 16 | { |
17 | - /** |
|
18 | - * {@inheritdoc} |
|
19 | - */ |
|
20 | - public function load(array $configs, ContainerBuilder $container) |
|
21 | - { |
|
22 | - $configuration = new Configuration(); |
|
23 | - $this->processConfiguration($configuration, $configs); |
|
17 | + /** |
|
18 | + * {@inheritdoc} |
|
19 | + */ |
|
20 | + public function load(array $configs, ContainerBuilder $container) |
|
21 | + { |
|
22 | + $configuration = new Configuration(); |
|
23 | + $this->processConfiguration($configuration, $configs); |
|
24 | 24 | |
25 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
26 | - $loader->load('services.yml'); |
|
27 | - } |
|
25 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
26 | + $loader->load('services.yml'); |
|
27 | + } |
|
28 | 28 | } |
@@ -12,13 +12,11 @@ |
||
12 | 12 | * |
13 | 13 | * @link http://symfony.com/doc/current/cookbook/bundles/extension.html |
14 | 14 | */ |
15 | -class RibsAdminExtension extends Extension |
|
16 | -{ |
|
15 | +class RibsAdminExtension extends Extension { |
|
17 | 16 | /** |
18 | 17 | * {@inheritdoc} |
19 | 18 | */ |
20 | - public function load(array $configs, ContainerBuilder $container) |
|
21 | - { |
|
19 | + public function load(array $configs, ContainerBuilder $container) { |
|
22 | 20 | $configuration = new Configuration(); |
23 | 21 | $this->processConfiguration($configuration, $configs); |
24 | 22 |
@@ -12,18 +12,18 @@ |
||
12 | 12 | */ |
13 | 13 | class Configuration implements ConfigurationInterface |
14 | 14 | { |
15 | - /** |
|
16 | - * {@inheritdoc} |
|
17 | - */ |
|
18 | - public function getConfigTreeBuilder() |
|
19 | - { |
|
20 | - $treeBuilder = new TreeBuilder(); |
|
21 | - $treeBuilder->root('ribs_admin'); |
|
15 | + /** |
|
16 | + * {@inheritdoc} |
|
17 | + */ |
|
18 | + public function getConfigTreeBuilder() |
|
19 | + { |
|
20 | + $treeBuilder = new TreeBuilder(); |
|
21 | + $treeBuilder->root('ribs_admin'); |
|
22 | 22 | |
23 | - // Here you should define the parameters that are allowed to |
|
24 | - // configure your bundle. See the documentation linked above for |
|
25 | - // more information on that topic. |
|
23 | + // Here you should define the parameters that are allowed to |
|
24 | + // configure your bundle. See the documentation linked above for |
|
25 | + // more information on that topic. |
|
26 | 26 | |
27 | - return $treeBuilder; |
|
28 | - } |
|
27 | + return $treeBuilder; |
|
28 | + } |
|
29 | 29 | } |
@@ -10,13 +10,11 @@ |
||
10 | 10 | * |
11 | 11 | * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html} |
12 | 12 | */ |
13 | -class Configuration implements ConfigurationInterface |
|
14 | -{ |
|
13 | +class Configuration implements ConfigurationInterface { |
|
15 | 14 | /** |
16 | 15 | * {@inheritdoc} |
17 | 16 | */ |
18 | - public function getConfigTreeBuilder() |
|
19 | - { |
|
17 | + public function getConfigTreeBuilder() { |
|
20 | 18 | $treeBuilder = new TreeBuilder(); |
21 | 19 | $treeBuilder->root('ribs_admin'); |
22 | 20 |
@@ -9,8 +9,7 @@ discard block |
||
9 | 9 | * @ORM\Entity(repositoryClass="Ribs\RibsAdminBundle\Repository\FosUserRepository") |
10 | 10 | * @ORM\Table(name="fos_user") |
11 | 11 | */ |
12 | -class FosUser extends BaseUser |
|
13 | -{ |
|
12 | +class FosUser extends BaseUser { |
|
14 | 13 | /** |
15 | 14 | * @ORM\Id |
16 | 15 | * @ORM\Column(type="integer") |
@@ -29,8 +28,7 @@ discard block |
||
29 | 28 | private $user; |
30 | 29 | |
31 | 30 | |
32 | - public function __construct() |
|
33 | - { |
|
31 | + public function __construct() { |
|
34 | 32 | parent::__construct(); |
35 | 33 | // your own logic |
36 | 34 | } |
@@ -38,16 +36,14 @@ discard block |
||
38 | 36 | /** |
39 | 37 | * @return User |
40 | 38 | */ |
41 | - public function getUser() |
|
42 | - { |
|
39 | + public function getUser() { |
|
43 | 40 | return $this->user; |
44 | 41 | } |
45 | 42 | |
46 | 43 | /** |
47 | 44 | * @param User $user |
48 | 45 | */ |
49 | - public function setUser($user) |
|
50 | - { |
|
46 | + public function setUser($user) { |
|
51 | 47 | $this->user = $user; |
52 | 48 | } |
53 | 49 |