@@ -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 | } |
@@ -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 | |
@@ -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 | |
@@ -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 | |
@@ -2,8 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ribs\RibsAdminBundle\Service; |
| 4 | 4 | |
| 5 | -class Globals |
|
| 6 | -{ |
|
| 5 | +class Globals { |
|
| 7 | 6 | /** |
| 8 | 7 | * @return string |
| 9 | 8 | */ |
@@ -5,8 +5,7 @@ |
||
| 5 | 5 | use Doctrine\ORM\EntityRepository; |
| 6 | 6 | use Ribs\RibsAdminBundle\Entity\User; |
| 7 | 7 | |
| 8 | -class FosUserRepository extends EntityRepository |
|
| 9 | -{ |
|
| 8 | +class FosUserRepository extends EntityRepository { |
|
| 10 | 9 | /** |
| 11 | 10 | * @param User $current_account |
| 12 | 11 | * @param bool $archived |