@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | * @package Platine\Framework\Kernel |
| 59 | 59 | * @template T |
| 60 | 60 | */ |
| 61 | -class ConsoleKernel extends BaseKernel |
|
| 62 | -{ |
|
| 61 | +class ConsoleKernel extends BaseKernel { |
|
| 63 | 62 | /** |
| 64 | 63 | * Console application instance |
| 65 | 64 | * @var ConsoleApp |
@@ -83,8 +82,7 @@ discard block |
||
| 83 | 82 | * @param Application $app |
| 84 | 83 | * @param ConsoleApp $console |
| 85 | 84 | */ |
| 86 | - public function __construct(Application $app, ConsoleApp $console) |
|
| 87 | - { |
|
| 85 | + public function __construct(Application $app, ConsoleApp $console) { |
|
| 88 | 86 | parent::__construct($app); |
| 89 | 87 | $this->console = $console; |
| 90 | 88 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | DatabaseConfigLoader::class |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | - $this->app->share(AppDatabaseConfig::class, function (ContainerInterface $app) { |
|
| 75 | + $this->app->share(AppDatabaseConfig::class, function(ContainerInterface $app) { |
|
| 76 | 76 | $env = $app->get(Config::class)->get('app.env', ''); |
| 77 | 77 | return new AppDatabaseConfig($app->get(DatabaseConfigLoaderInterface::class), $env); |
| 78 | 78 | }); |
@@ -59,8 +59,7 @@ |
||
| 59 | 59 | * @class DatabaseConfigServiceProvider |
| 60 | 60 | * @package Platine\Framework\Service\Provider |
| 61 | 61 | */ |
| 62 | -class DatabaseConfigServiceProvider extends ServiceProvider |
|
| 63 | -{ |
|
| 62 | +class DatabaseConfigServiceProvider extends ServiceProvider { |
|
| 64 | 63 | /** |
| 65 | 64 | * {@inheritdoc} |
| 66 | 65 | */ |
@@ -68,19 +68,19 @@ |
||
| 68 | 68 | 'updated_at' => '?date', |
| 69 | 69 | ]); |
| 70 | 70 | |
| 71 | - $mapper->filter('status', function (Query $q, $value) { |
|
| 71 | + $mapper->filter('status', function(Query $q, $value) { |
|
| 72 | 72 | $q->where('status')->is($value); |
| 73 | 73 | }); |
| 74 | 74 | |
| 75 | - $mapper->filter('env', function (Query $q, $value) { |
|
| 75 | + $mapper->filter('env', function(Query $q, $value) { |
|
| 76 | 76 | $q->where('env')->is($value); |
| 77 | 77 | }); |
| 78 | 78 | |
| 79 | - $mapper->filter('module', function (Query $q, $value) { |
|
| 79 | + $mapper->filter('module', function(Query $q, $value) { |
|
| 80 | 80 | $q->where('module')->is($value); |
| 81 | 81 | }); |
| 82 | 82 | |
| 83 | - $mapper->filter('type', function (Query $q, $value) { |
|
| 83 | + $mapper->filter('type', function(Query $q, $value) { |
|
| 84 | 84 | $q->where('type')->is($value); |
| 85 | 85 | }); |
| 86 | 86 | } |
@@ -56,8 +56,7 @@ |
||
| 56 | 56 | * @package Platine\Framework\Config\Model |
| 57 | 57 | * @extends Entity<Configuration> |
| 58 | 58 | */ |
| 59 | -class Configuration extends Entity |
|
| 60 | -{ |
|
| 59 | +class Configuration extends Entity { |
|
| 61 | 60 | /** |
| 62 | 61 | * |
| 63 | 62 | * @param EntityMapperInterface<Configuration> $mapper |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | ->query() |
| 129 | 129 | ->where('module')->is($group) |
| 130 | 130 | ->where('status')->is('Y') |
| 131 | - ->where(function (WhereStatement $where) use ($env) { |
|
| 131 | + ->where(function(WhereStatement $where) use ($env) { |
|
| 132 | 132 | $where->where('env')->is($env) |
| 133 | 133 | ->orWhere('env')->isNull(); |
| 134 | 134 | }); |
@@ -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 | } |
@@ -129,10 +129,10 @@ |
||
| 129 | 129 | $name = $results['key']; |
| 130 | 130 | |
| 131 | 131 | $config = $this->loader->loadConfig([ |
| 132 | - 'name' => $name, |
|
| 133 | - 'module' => $module, |
|
| 134 | - 'env' => $this->env |
|
| 135 | - ]); |
|
| 132 | + 'name' => $name, |
|
| 133 | + 'module' => $module, |
|
| 134 | + 'env' => $this->env |
|
| 135 | + ]); |
|
| 136 | 136 | |
| 137 | 137 | if ($config === null) { |
| 138 | 138 | $this->loader->insertConfig([ |
@@ -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 | } |
@@ -51,16 +51,14 @@ |
||
| 51 | 51 | * @class ConfigUtil |
| 52 | 52 | * @package Platine\Framework\Config |
| 53 | 53 | */ |
| 54 | -class ConfigUtil |
|
| 55 | -{ |
|
| 54 | +class ConfigUtil { |
|
| 56 | 55 | /** |
| 57 | 56 | * Convert the returned configuration to given type |
| 58 | 57 | * @param mixed $value |
| 59 | 58 | * @param string $type |
| 60 | 59 | * @return mixed |
| 61 | 60 | */ |
| 62 | - public static function convertToDataType($value, string $type) |
|
| 63 | - { |
|
| 61 | + public static function convertToDataType($value, string $type) { |
|
| 64 | 62 | switch ($type) { |
| 65 | 63 | case 'integer': |
| 66 | 64 | $value = intval($value); |
@@ -62,8 +62,7 @@ |
||
| 62 | 62 | * @class ApiAuthServiceProvider |
| 63 | 63 | * @package Platine\Framework\Service\Provider |
| 64 | 64 | */ |
| 65 | -class ApiAuthServiceProvider extends ServiceProvider |
|
| 66 | -{ |
|
| 65 | +class ApiAuthServiceProvider extends ServiceProvider { |
|
| 67 | 66 | /** |
| 68 | 67 | * {@inheritdoc} |
| 69 | 68 | */ |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | * @class AuditServiceProvider |
| 56 | 56 | * @package Platine\Framework\Service\Provider |
| 57 | 57 | */ |
| 58 | -class AuditServiceProvider extends ServiceProvider |
|
| 59 | -{ |
|
| 58 | +class AuditServiceProvider extends ServiceProvider { |
|
| 60 | 59 | /** |
| 61 | 60 | * {@inheritdoc} |
| 62 | 61 | */ |
@@ -66,19 +66,19 @@ |
||
| 66 | 66 | 'date' => 'date', |
| 67 | 67 | ]); |
| 68 | 68 | |
| 69 | - $mapper->filter('start_date', function (Query $q, $value) { |
|
| 69 | + $mapper->filter('start_date', function(Query $q, $value) { |
|
| 70 | 70 | $q->where('date')->gte($value); |
| 71 | 71 | }); |
| 72 | 72 | |
| 73 | - $mapper->filter('end_date', function (Query $q, $value) { |
|
| 73 | + $mapper->filter('end_date', function(Query $q, $value) { |
|
| 74 | 74 | $q->where('date')->lte($value); |
| 75 | 75 | }); |
| 76 | 76 | |
| 77 | - $mapper->filter('event', function (Query $q, $value) { |
|
| 77 | + $mapper->filter('event', function(Query $q, $value) { |
|
| 78 | 78 | $q->where('event')->is($value); |
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | - $mapper->filter('user', function (Query $q, $value) { |
|
| 81 | + $mapper->filter('user', function(Query $q, $value) { |
|
| 82 | 82 | $q->where('user_id')->is($value); |
| 83 | 83 | }); |
| 84 | 84 | } |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | * @package Platine\Framework\Audit\Model |
| 58 | 58 | * @extends Entity<Audit> |
| 59 | 59 | */ |
| 60 | -class Audit extends Entity |
|
| 61 | -{ |
|
| 60 | +class Audit extends Entity { |
|
| 62 | 61 | /** |
| 63 | 62 | * |
| 64 | 63 | * @param EntityMapperInterface<Audit> $mapper |