@@ -55,8 +55,7 @@ |
||
| 55 | 55 | * @package Platine\Framework\Config |
| 56 | 56 | * @template TEntity as Entity |
| 57 | 57 | */ |
| 58 | -interface DatabaseConfigLoaderInterface extends LoaderInterface |
|
| 59 | -{ |
|
| 58 | +interface DatabaseConfigLoaderInterface extends LoaderInterface { |
|
| 60 | 59 | /** |
| 61 | 60 | * Load the configuration from database |
| 62 | 61 | * @param array<string, mixed> $where |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | * @template TEntity as Configuration |
| 60 | 60 | * @implements ArrayAccess<string, mixed> |
| 61 | 61 | */ |
| 62 | -class AppDatabaseConfig implements ArrayAccess |
|
| 63 | -{ |
|
| 62 | +class AppDatabaseConfig implements ArrayAccess { |
|
| 64 | 63 | /** |
| 65 | 64 | * The configuration loader to use |
| 66 | 65 | * @var DatabaseConfigLoaderInterface<TEntity> |
@@ -84,8 +83,7 @@ discard block |
||
| 84 | 83 | * @param DatabaseConfigLoaderInterface<TEntity> $loader the loader to use |
| 85 | 84 | * @param string $env the name of the environment |
| 86 | 85 | */ |
| 87 | - public function __construct(DatabaseConfigLoaderInterface $loader, string $env = '') |
|
| 88 | - { |
|
| 86 | + public function __construct(DatabaseConfigLoaderInterface $loader, string $env = '') { |
|
| 89 | 87 | $this->loader = $loader; |
| 90 | 88 | $this->env = $env; |
| 91 | 89 | } |
@@ -107,8 +105,7 @@ discard block |
||
| 107 | 105 | * not find the configuration item |
| 108 | 106 | * @return mixed |
| 109 | 107 | */ |
| 110 | - public function get(string $key, $default = null) |
|
| 111 | - { |
|
| 108 | + public function get(string $key, $default = null) { |
|
| 112 | 109 | $results = $this->parseKey($key); |
| 113 | 110 | $group = $results['group']; |
| 114 | 111 | |
@@ -217,16 +214,14 @@ discard block |
||
| 217 | 214 | /** |
| 218 | 215 | * {@inheritdoc} |
| 219 | 216 | */ |
| 220 | - public function offsetExists($key) |
|
| 221 | - { |
|
| 217 | + public function offsetExists($key) { |
|
| 222 | 218 | return $this->has($key); |
| 223 | 219 | } |
| 224 | 220 | |
| 225 | 221 | /** |
| 226 | 222 | * {@inheritdoc} |
| 227 | 223 | */ |
| 228 | - public function offsetGet($key) |
|
| 229 | - { |
|
| 224 | + public function offsetGet($key) { |
|
| 230 | 225 | return $this->get($key); |
| 231 | 226 | } |
| 232 | 227 | |
@@ -236,16 +231,14 @@ discard block |
||
| 236 | 231 | * @param mixed $value |
| 237 | 232 | * @return void |
| 238 | 233 | */ |
| 239 | - public function offsetSet($key, $value) |
|
| 240 | - { |
|
| 234 | + public function offsetSet($key, $value) { |
|
| 241 | 235 | $this->set($key, $value); |
| 242 | 236 | } |
| 243 | 237 | |
| 244 | 238 | /** |
| 245 | 239 | * {@inheritdoc} |
| 246 | 240 | */ |
| 247 | - public function offsetUnset($key) |
|
| 248 | - { |
|
| 241 | + public function offsetUnset($key) { |
|
| 249 | 242 | $this->set($key, null); |
| 250 | 243 | } |
| 251 | 244 | |
@@ -294,8 +287,7 @@ discard block |
||
| 294 | 287 | * @param mixed $value |
| 295 | 288 | * @return mixed |
| 296 | 289 | */ |
| 297 | - protected function getFormattedConfigValue($value) |
|
| 298 | - { |
|
| 290 | + protected function getFormattedConfigValue($value) { |
|
| 299 | 291 | if (is_array($value) || is_object($value)) { |
| 300 | 292 | return serialize($value); |
| 301 | 293 | } |
@@ -55,6 +55,5 @@ |
||
| 55 | 55 | * @template TEntity as \Platine\Orm\Entity |
| 56 | 56 | * @extends RepositoryInterface<TEntity> |
| 57 | 57 | */ |
| 58 | -interface ConfigurationRepositoryInterface extends RepositoryInterface |
|
| 59 | -{ |
|
| 58 | +interface ConfigurationRepositoryInterface extends RepositoryInterface { |
|
| 60 | 59 | } |
@@ -57,14 +57,12 @@ |
||
| 57 | 57 | * @extends Repository<Configuration> |
| 58 | 58 | * @implements ConfigurationRepositoryInterface<Configuration> |
| 59 | 59 | */ |
| 60 | -class ConfigurationRepository extends Repository implements ConfigurationRepositoryInterface |
|
| 61 | -{ |
|
| 60 | +class ConfigurationRepository extends Repository implements ConfigurationRepositoryInterface { |
|
| 62 | 61 | /** |
| 63 | 62 | * Create new instance |
| 64 | 63 | * @param EntityManager<Configuration> $manager |
| 65 | 64 | */ |
| 66 | - public function __construct(EntityManager $manager) |
|
| 67 | - { |
|
| 65 | + public function __construct(EntityManager $manager) { |
|
| 68 | 66 | parent::__construct($manager, Configuration::class); |
| 69 | 67 | } |
| 70 | 68 | } |
@@ -56,8 +56,7 @@ discard block |
||
| 56 | 56 | * @package Platine\Framework\Config |
| 57 | 57 | * @implements DatabaseConfigLoaderInterface<Configuration> |
| 58 | 58 | */ |
| 59 | -class DatabaseConfigLoader implements DatabaseConfigLoaderInterface |
|
| 60 | -{ |
|
| 59 | +class DatabaseConfigLoader implements DatabaseConfigLoaderInterface { |
|
| 61 | 60 | /** |
| 62 | 61 | * The Repository instance |
| 63 | 62 | * @var ConfigurationRepositoryInterface<Configuration> |
@@ -69,8 +68,7 @@ discard block |
||
| 69 | 68 | * Create new instance |
| 70 | 69 | * @param ConfigurationRepositoryInterface<Configuration> $repository |
| 71 | 70 | */ |
| 72 | - public function __construct(ConfigurationRepositoryInterface $repository) |
|
| 73 | - { |
|
| 71 | + public function __construct(ConfigurationRepositoryInterface $repository) { |
|
| 74 | 72 | $this->repository = $repository; |
| 75 | 73 | } |
| 76 | 74 | |
@@ -93,8 +91,7 @@ discard block |
||
| 93 | 91 | /** |
| 94 | 92 | * {@inheritdoc} |
| 95 | 93 | */ |
| 96 | - public function insertConfig(array $data) |
|
| 97 | - { |
|
| 94 | + public function insertConfig(array $data) { |
|
| 98 | 95 | $entity = $this->repository->create($data); |
| 99 | 96 | return $this->repository->insert($entity); |
| 100 | 97 | } |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | * @package Platine\Framework\Template\Tag |
| 58 | 58 | * @template T |
| 59 | 59 | */ |
| 60 | -class CsrfTag extends AbstractTag |
|
| 61 | -{ |
|
| 60 | +class CsrfTag extends AbstractTag { |
|
| 62 | 61 | /** |
| 63 | 62 | * {@inheritdoc} |
| 64 | 63 | */ |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | ); |
| 138 | 138 | |
| 139 | 139 | $httpException->setTitle('Service Unavailable') |
| 140 | - ->setDescription($message); |
|
| 140 | + ->setDescription($message); |
|
| 141 | 141 | |
| 142 | 142 | // TODO Add headers |
| 143 | 143 | throw $httpException; |
@@ -241,9 +241,9 @@ discard block |
||
| 241 | 241 | $sessionCookieConfig = $this->config->get('session.cookie', []); |
| 242 | 242 | |
| 243 | 243 | $cookie->withExpires($expire) |
| 244 | - ->withPath($sessionCookieConfig['path'] ?? null) |
|
| 245 | - ->withDomain($sessionCookieConfig['domain'] ?? null) |
|
| 246 | - ->withHttpOnly(true); |
|
| 244 | + ->withPath($sessionCookieConfig['path'] ?? null) |
|
| 245 | + ->withDomain($sessionCookieConfig['domain'] ?? null) |
|
| 246 | + ->withHttpOnly(true); |
|
| 247 | 247 | |
| 248 | 248 | |
| 249 | 249 | return $cookie; |
@@ -70,8 +70,7 @@ |
||
| 70 | 70 | * @package Platine\Framework\Http\Middleware |
| 71 | 71 | * @template T |
| 72 | 72 | */ |
| 73 | -class MaintenanceMiddleware implements MiddlewareInterface |
|
| 74 | -{ |
|
| 73 | +class MaintenanceMiddleware implements MiddlewareInterface { |
|
| 75 | 74 | /** |
| 76 | 75 | * The configuration instance |
| 77 | 76 | * @var Config<T> |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | * @package Platine\Framework\Security\Csrf |
| 60 | 60 | * @template T |
| 61 | 61 | */ |
| 62 | -class CsrfManager |
|
| 63 | -{ |
|
| 62 | +class CsrfManager { |
|
| 64 | 63 | /** |
| 65 | 64 | * The application configuration class |
| 66 | 65 | * @var Config<T> |
@@ -188,8 +187,7 @@ discard block |
||
| 188 | 187 | * @param string $key |
| 189 | 188 | * @return mixed |
| 190 | 189 | */ |
| 191 | - private function getConfigValue(string $key) |
|
| 192 | - { |
|
| 190 | + private function getConfigValue(string $key) { |
|
| 193 | 191 | $config = $this->config->get('security.csrf', []); |
| 194 | 192 | |
| 195 | 193 | return $config[$key] ?? null; |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class CsrfNullStorage |
| 54 | 54 | * @package Platine\Framework\Security\Csrf\Storage |
| 55 | 55 | */ |
| 56 | -class CsrfNullStorage implements CsrfStorageInterface |
|
| 57 | -{ |
|
| 56 | +class CsrfNullStorage implements CsrfStorageInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * The CSRF data |
| 60 | 59 | * @var array<string, string> |