@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function getCacheDir() |
| 39 | 39 | { |
| 40 | - return $this->getRootDir().'/var/cache/'.$this->environment; |
|
| 40 | + return $this->getRootDir() . '/var/cache/' . $this->environment; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function getConfigurationDir() |
| 44 | 44 | { |
| 45 | - return $this->getRootDir().'/config'; |
|
| 45 | + return $this->getRootDir() . '/config'; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function getEnvironment() |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | public function getLogDir() |
| 54 | 54 | { |
| 55 | - return $this->getRootDir().'/var/log'; |
|
| 55 | + return $this->getRootDir() . '/var/log'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function getRootDir() |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | protected function configureContainer() |
| 68 | 68 | { |
| 69 | 69 | $container = $this->getContainer(); |
| 70 | - require $this->getConfigurationDir().'/container.php'; |
|
| 70 | + require $this->getConfigurationDir() . '/container.php'; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | protected function loadConfiguration() |
| 74 | 74 | { |
| 75 | 75 | $app = $this; |
| 76 | 76 | $configuration = [ |
| 77 | - 'settings' => require $this->getConfigurationDir().'/slim.php' |
|
| 77 | + 'settings' => require $this->getConfigurationDir() . '/slim.php' |
|
| 78 | 78 | ]; |
| 79 | 79 | |
| 80 | - if (file_exists($this->getConfigurationDir().'/services.'.$this->getEnvironment().'.php')) { |
|
| 81 | - $configuration['settings'] += require $this->getConfigurationDir().'/services.'.$this->getEnvironment().'.php'; |
|
| 80 | + if (file_exists($this->getConfigurationDir() . '/services.' . $this->getEnvironment() . '.php')) { |
|
| 81 | + $configuration['settings'] += require $this->getConfigurationDir() . '/services.' . $this->getEnvironment() . '.php'; |
|
| 82 | 82 | } else { |
| 83 | - $configuration['settings'] += require $this->getConfigurationDir().'/services.php'; |
|
| 83 | + $configuration['settings'] += require $this->getConfigurationDir() . '/services.php'; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return $configuration; |
@@ -90,23 +90,23 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $app = $this; |
| 92 | 92 | $container = $this->getContainer(); |
| 93 | - require $this->getConfigurationDir().'/middleware.php'; |
|
| 93 | + require $this->getConfigurationDir() . '/middleware.php'; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | protected function loadRoutes() |
| 97 | 97 | { |
| 98 | 98 | $app = $this; |
| 99 | 99 | $container = $this->getContainer(); |
| 100 | - require $this->getConfigurationDir().'/routes.php'; |
|
| 100 | + require $this->getConfigurationDir() . '/routes.php'; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | protected function registerControllers() |
| 104 | 104 | { |
| 105 | 105 | $container = $this->getContainer(); |
| 106 | - if (file_exists($this->getConfigurationDir().'/controllers.php')) { |
|
| 107 | - $controllers = require $this->getConfigurationDir().'/controllers.php'; |
|
| 106 | + if (file_exists($this->getConfigurationDir() . '/controllers.php')) { |
|
| 107 | + $controllers = require $this->getConfigurationDir() . '/controllers.php'; |
|
| 108 | 108 | foreach ($controllers as $key => $class) { |
| 109 | - $container[$key] = function ($container) use ($class) { |
|
| 109 | + $container[$key] = function($container) use ($class) { |
|
| 110 | 110 | return new $class($container); |
| 111 | 111 | }; |
| 112 | 112 | } |
@@ -116,6 +116,6 @@ discard block |
||
| 116 | 116 | protected function registerHandlers() |
| 117 | 117 | { |
| 118 | 118 | $container = $this->getContainer(); |
| 119 | - require $this->getConfigurationDir().'/handlers.php'; |
|
| 119 | + require $this->getConfigurationDir() . '/handlers.php'; |
|
| 120 | 120 | } |
| 121 | 121 | } |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | public function csrfFields() |
| 42 | 42 | { |
| 43 | 43 | return ' |
| 44 | - <input type="hidden" name="'.$this->csrf->getTokenNameKey().'" value="'.$this->csrf->getTokenName().'"> |
|
| 45 | - <input type="hidden" name="'.$this->csrf->getTokenValueKey().'" value="'.$this->csrf->getTokenValue().'"> |
|
| 44 | + <input type="hidden" name="'.$this->csrf->getTokenNameKey() . '" value="' . $this->csrf->getTokenName() . '"> |
|
| 45 | + <input type="hidden" name="'.$this->csrf->getTokenValueKey() . '" value="' . $this->csrf->getTokenValue() . '"> |
|
| 46 | 46 | '; |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -50,9 +50,9 @@ |
||
| 50 | 50 | public function asset($path) |
| 51 | 51 | { |
| 52 | 52 | if (null !== $this->basePath) { |
| 53 | - return $this->request->getUri()->getBaseUrl().'/'.trim($this->basePath, '/').'/'.$path; |
|
| 53 | + return $this->request->getUri()->getBaseUrl() . '/' . trim($this->basePath, '/') . '/' . $path; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return $this->request->getUri()->getBaseUrl().'/'.$path; |
|
| 56 | + return $this->request->getUri()->getBaseUrl() . '/' . $path; |
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | if (!$input->getArgument('username')) { |
| 87 | 87 | $question = new Question('Please choose a username:'); |
| 88 | - $question->setValidator(function ($username) { |
|
| 88 | + $question->setValidator(function($username) { |
|
| 89 | 89 | if (empty($username)) { |
| 90 | 90 | throw new Exception('Username can not be empty'); |
| 91 | 91 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | if (!$input->getArgument('email')) { |
| 99 | 99 | $question = new Question('Please choose an email:'); |
| 100 | - $question->setValidator(function ($email) { |
|
| 100 | + $question->setValidator(function($email) { |
|
| 101 | 101 | if (empty($email)) { |
| 102 | 102 | throw new Exception('Email can not be empty'); |
| 103 | 103 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | if (!$input->getArgument('password')) { |
| 112 | 112 | $question = new Question('Please choose a password:'); |
| 113 | - $question->setValidator(function ($password) { |
|
| 113 | + $question->setValidator(function($password) { |
|
| 114 | 114 | if (empty($password)) { |
| 115 | 115 | throw new Exception('Password can not be empty'); |
| 116 | 116 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | protected function execute(InputInterface $input, OutputInterface $output) |
| 25 | 25 | { |
| 26 | - require __DIR__.'/../../config/database/index.php'; |
|
| 26 | + require __DIR__ . '/../../config/database/index.php'; |
|
| 27 | 27 | |
| 28 | 28 | return 0; |
| 29 | 29 | } |