@@ -20,7 +20,7 @@  | 
                                                    ||
| 20 | 20 | 'invalidate_session' => true  | 
                                                        
| 21 | 21 | ],  | 
                                                        
| 22 | 22 | 'anonymous' => true,  | 
                                                        
| 23 | -        'users' => function ($app) { | 
                                                        |
| 23 | +        'users' => function($app) { | 
                                                        |
| 24 | 24 | return $app['silex_user.user_provider.username_email'];  | 
                                                        
| 25 | 25 | }  | 
                                                        
| 26 | 26 | ]  | 
                                                        
@@ -3,7 +3,7 @@  | 
                                                    ||
| 3 | 3 | use Symfony\Component\HttpFoundation\Request;  | 
                                                        
| 4 | 4 | use Symfony\Component\HttpFoundation\Response;  | 
                                                        
| 5 | 5 | |
| 6 | -$app->error(function (Exception $e, Request $request, $code) use ($app) { | 
                                                        |
| 6 | +$app->error(function(Exception $e, Request $request, $code) use ($app) { | 
                                                        |
| 7 | 7 | $templates = [  | 
                                                        
| 8 | 8 | 'error/' . $code . '.twig',  | 
                                                        
| 9 | 9 | 'error/' . substr($code, 0, 1) . 'xx.twig',  | 
                                                        
@@ -4,13 +4,13 @@  | 
                                                    ||
| 4 | 4 | use Symfony\Component\Debug\Debug;  | 
                                                        
| 5 | 5 | use Symfony\Component\Dotenv\Dotenv;  | 
                                                        
| 6 | 6 | |
| 7 | -require __DIR__.'/../vendor/autoload.php';  | 
                                                        |
| 7 | +require __DIR__ . '/../vendor/autoload.php';  | 
                                                        |
| 8 | 8 | |
| 9 | 9 |  if (!isset($_SERVER['APP_ENV'])) { | 
                                                        
| 10 | 10 |      if (!class_exists(Dotenv::class)) { | 
                                                        
| 11 | 11 |          throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); | 
                                                        
| 12 | 12 | }  | 
                                                        
| 13 | - (new Dotenv())->load(__DIR__.'/../.env');  | 
                                                        |
| 13 | + (new Dotenv())->load(__DIR__ . '/../.env');  | 
                                                        |
| 14 | 14 | }  | 
                                                        
| 15 | 15 | |
| 16 | 16 | $env = $_SERVER['APP_ENV'] ?? 'dev';  | 
                                                        
@@ -10,7 +10,7 @@  | 
                                                    ||
| 10 | 10 |      if (!class_exists(Dotenv::class)) { | 
                                                        
| 11 | 11 |          throw new \RuntimeException('APP_TEST_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); | 
                                                        
| 12 | 12 | }  | 
                                                        
| 13 | - (new Dotenv())->load(__DIR__.'/../.env');  | 
                                                        |
| 13 | + (new Dotenv())->load(__DIR__ . '/../.env');  | 
                                                        |
| 14 | 14 | }  | 
                                                        
| 15 | 15 | |
| 16 | 16 | $env = $_SERVER['APP_TEST_ENV'] ?? 'test';  | 
                                                        
@@ -49,12 +49,12 @@ discard block  | 
                                                    ||
| 49 | 49 | |
| 50 | 50 | public function getCacheDir()  | 
                                                        
| 51 | 51 |      { | 
                                                        
| 52 | - return $this->getRootDir().'/var/cache/'.$this->environment;  | 
                                                        |
| 52 | + return $this->getRootDir() . '/var/cache/' . $this->environment;  | 
                                                        |
| 53 | 53 | }  | 
                                                        
| 54 | 54 | |
| 55 | 55 | public function getConfigurationDir()  | 
                                                        
| 56 | 56 |      { | 
                                                        
| 57 | - return $this->getRootDir().'/config';  | 
                                                        |
| 57 | + return $this->getRootDir() . '/config';  | 
                                                        |
| 58 | 58 | }  | 
                                                        
| 59 | 59 | |
| 60 | 60 | public function getEnvironment()  | 
                                                        
@@ -64,7 +64,7 @@ discard block  | 
                                                    ||
| 64 | 64 | |
| 65 | 65 | public function getLogDir()  | 
                                                        
| 66 | 66 |      { | 
                                                        
| 67 | - return $this->getRootDir().'/var/log';  | 
                                                        |
| 67 | + return $this->getRootDir() . '/var/log';  | 
                                                        |
| 68 | 68 | }  | 
                                                        
| 69 | 69 | |
| 70 | 70 | public function getRootDir()  | 
                                                        
@@ -79,25 +79,25 @@ discard block  | 
                                                    ||
| 79 | 79 | public function loadConfiguration()  | 
                                                        
| 80 | 80 |      { | 
                                                        
| 81 | 81 | $app = $this;  | 
                                                        
| 82 | -        if (file_exists($this->getConfigurationDir().'/container.'.$this->getEnvironment().'.php')) { | 
                                                        |
| 83 | - require $this->getConfigurationDir().'/container.'.$this->getEnvironment().'.php';  | 
                                                        |
| 82 | +        if (file_exists($this->getConfigurationDir() . '/container.' . $this->getEnvironment() . '.php')) { | 
                                                        |
| 83 | + require $this->getConfigurationDir() . '/container.' . $this->getEnvironment() . '.php';  | 
                                                        |
| 84 | 84 |          } else { | 
                                                        
| 85 | - require $this->getConfigurationDir().'/container.php';  | 
                                                        |
| 85 | + require $this->getConfigurationDir() . '/container.php';  | 
                                                        |
| 86 | 86 | }  | 
                                                        
| 87 | 87 | }  | 
                                                        
| 88 | 88 | |
| 89 | 89 | public function loadRoutes()  | 
                                                        
| 90 | 90 |      { | 
                                                        
| 91 | 91 | $app = $this;  | 
                                                        
| 92 | - require $this->getConfigurationDir().'/routes.php';  | 
                                                        |
| 92 | + require $this->getConfigurationDir() . '/routes.php';  | 
                                                        |
| 93 | 93 | }  | 
                                                        
| 94 | 94 | |
| 95 | 95 | public function registerControllers()  | 
                                                        
| 96 | 96 |      { | 
                                                        
| 97 | -        if (file_exists($this->getConfigurationDir().'/controllers.php')) { | 
                                                        |
| 98 | - $controllers = require $this->getConfigurationDir().'/controllers.php';  | 
                                                        |
| 97 | +        if (file_exists($this->getConfigurationDir() . '/controllers.php')) { | 
                                                        |
| 98 | + $controllers = require $this->getConfigurationDir() . '/controllers.php';  | 
                                                        |
| 99 | 99 |              foreach ($controllers as $key => $class) { | 
                                                        
| 100 | -                $this[$key] = function ($app) use ($class) { | 
                                                        |
| 100 | +                $this[$key] = function($app) use ($class) { | 
                                                        |
| 101 | 101 | return new $class($app);  | 
                                                        
| 102 | 102 | };  | 
                                                        
| 103 | 103 | }  | 
                                                        
@@ -107,12 +107,12 @@ discard block  | 
                                                    ||
| 107 | 107 | public function registerHandlers()  | 
                                                        
| 108 | 108 |      { | 
                                                        
| 109 | 109 | $app = $this;  | 
                                                        
| 110 | - require $this->getConfigurationDir().'/handlers.php';  | 
                                                        |
| 110 | + require $this->getConfigurationDir() . '/handlers.php';  | 
                                                        |
| 111 | 111 | }  | 
                                                        
| 112 | 112 | |
| 113 | 113 | public function registerProviders()  | 
                                                        
| 114 | 114 |      { | 
                                                        
| 115 | - $providers = require $this->getConfigurationDir().'/providers.php';  | 
                                                        |
| 115 | + $providers = require $this->getConfigurationDir() . '/providers.php';  | 
                                                        |
| 116 | 116 |          foreach ($providers as $class => $environments) { | 
                                                        
| 117 | 117 |              if (isset($environments['all']) || isset($environments[$this->environment])) { | 
                                                        
| 118 | 118 | $this->register(new $class());  | 
                                                        
@@ -1,5 +1,5 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | |
| 3 | -require $app->getConfigurationDir().'/container.php';  | 
                                                        |
| 3 | +require $app->getConfigurationDir() . '/container.php';  | 
                                                        |
| 4 | 4 | |
| 5 | -$app['profiler.cache_dir'] = $app->getCacheDir().'/profiler';  | 
                                                        |
| 5 | +$app['profiler.cache_dir'] = $app->getCacheDir() . '/profiler';  | 
                                                        |
@@ -1,10 +1,10 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | |
| 3 | -require $app->getConfigurationDir().'/container.dev.php';  | 
                                                        |
| 3 | +require $app->getConfigurationDir() . '/container.dev.php';  | 
                                                        |
| 4 | 4 | |
| 5 | 5 | $app['db.options'] = [  | 
                                                        
| 6 | 6 | 'driver' => 'pdo_sqlite',  | 
                                                        
| 7 | - 'path' => $app->getCacheDir().'/test.db'  | 
                                                        |
| 7 | + 'path' => $app->getCacheDir() . '/test.db'  | 
                                                        |
| 8 | 8 | ];  | 
                                                        
| 9 | 9 | |
| 10 | 10 | $app['session.test'] = true;  | 
                                                        
@@ -2,7 +2,7 @@ discard block  | 
                                                    ||
| 2 | 2 | |
| 3 | 3 | use App\Entity\User;  | 
                                                        
| 4 | 4 | |
| 5 | -require $app->getConfigurationDir().'/security.php';  | 
                                                        |
| 5 | +require $app->getConfigurationDir() . '/security.php';  | 
                                                        |
| 6 | 6 | |
| 7 | 7 | $app['assets.version'] = 'v1';  | 
                                                        
| 8 | 8 | |
@@ -14,16 +14,16 @@ discard block  | 
                                                    ||
| 14 | 14 | 'dbname' => $_SERVER['APP_DATABASE_NAME']  | 
                                                        
| 15 | 15 | ];  | 
                                                        
| 16 | 16 | |
| 17 | -$app['monolog.logfile'] = $app->getLogDir().'/'.$app->getEnvironment().'.log';  | 
                                                        |
| 17 | +$app['monolog.logfile'] = $app->getLogDir() . '/' . $app->getEnvironment() . '.log';  | 
                                                        |
| 18 | 18 | |
| 19 | 19 | // https://github.com/dflydev/dflydev-doctrine-orm-service-provider  | 
                                                        
| 20 | -$app['orm.proxies_dir'] = $app->getCacheDir().'/doctrine/orm/proxies';  | 
                                                        |
| 20 | +$app['orm.proxies_dir'] = $app->getCacheDir() . '/doctrine/orm/proxies';  | 
                                                        |
| 21 | 21 | $app['orm.em.options'] = [  | 
                                                        
| 22 | 22 | 'mappings' => [  | 
                                                        
| 23 | 23 | [  | 
                                                        
| 24 | 24 | 'type' => 'annotation',  | 
                                                        
| 25 | 25 | 'namespace' => 'App\Entity',  | 
                                                        
| 26 | - 'path' => $app->getRootDir().'/src/Entity',  | 
                                                        |
| 26 | + 'path' => $app->getRootDir() . '/src/Entity',  | 
                                                        |
| 27 | 27 | 'use_simple_annotation_reader' => false  | 
                                                        
| 28 | 28 | ]  | 
                                                        
| 29 | 29 | ]  | 
                                                        
@@ -49,12 +49,12 @@ discard block  | 
                                                    ||
| 49 | 49 | 'auth_mode' => $_SERVER['APP_MAILER_AUTH_MODE']  | 
                                                        
| 50 | 50 | ];  | 
                                                        
| 51 | 51 | |
| 52 | -$app['translator.cache_dir'] = $app->getCacheDir().'/translations';  | 
                                                        |
| 52 | +$app['translator.cache_dir'] = $app->getCacheDir() . '/translations';  | 
                                                        |
| 53 | 53 | |
| 54 | 54 | $app['twig.options'] = [  | 
                                                        
| 55 | - 'cache' => $app->getCacheDir().'/twig'  | 
                                                        |
| 55 | + 'cache' => $app->getCacheDir() . '/twig'  | 
                                                        |
| 56 | 56 | ];  | 
                                                        
| 57 | 57 | |
| 58 | 58 | $app['twig.path'] = [  | 
                                                        
| 59 | - $app->getRootDir().'/templates'  | 
                                                        |
| 59 | + $app->getRootDir() . '/templates'  | 
                                                        |
| 60 | 60 | ];  |