@@ -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([ |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | * @template TDbConfigurationEntity as \Platine\Framework\Config\Model\Configuration |
58 | 58 | * @implements ArrayAccess<string, mixed> |
59 | 59 | */ |
60 | -class AppDatabaseConfig implements ArrayAccess |
|
61 | -{ |
|
60 | +class AppDatabaseConfig implements ArrayAccess { |
|
62 | 61 | /** |
63 | 62 | * The configuration loader to use |
64 | 63 | * @var DatabaseConfigLoaderInterface<TDbConfigurationEntity> |
@@ -82,8 +81,7 @@ discard block |
||
82 | 81 | * @param DatabaseConfigLoaderInterface<TDbConfigurationEntity> $loader the loader to use |
83 | 82 | * @param string $env the name of the environment |
84 | 83 | */ |
85 | - public function __construct(DatabaseConfigLoaderInterface $loader, string $env = '') |
|
86 | - { |
|
84 | + public function __construct(DatabaseConfigLoaderInterface $loader, string $env = '') { |
|
87 | 85 | $this->loader = $loader; |
88 | 86 | $this->env = $env; |
89 | 87 | } |
@@ -105,8 +103,7 @@ discard block |
||
105 | 103 | * not find the configuration item |
106 | 104 | * @return mixed |
107 | 105 | */ |
108 | - public function get(string $key, $default = null) |
|
109 | - { |
|
106 | + public function get(string $key, $default = null) { |
|
110 | 107 | $results = $this->parseKey($key); |
111 | 108 | $group = $results['group']; |
112 | 109 | |
@@ -215,16 +212,14 @@ discard block |
||
215 | 212 | /** |
216 | 213 | * {@inheritdoc} |
217 | 214 | */ |
218 | - public function offsetExists($key) |
|
219 | - { |
|
215 | + public function offsetExists($key) { |
|
220 | 216 | return $this->has($key); |
221 | 217 | } |
222 | 218 | |
223 | 219 | /** |
224 | 220 | * {@inheritdoc} |
225 | 221 | */ |
226 | - public function offsetGet($key) |
|
227 | - { |
|
222 | + public function offsetGet($key) { |
|
228 | 223 | return $this->get($key); |
229 | 224 | } |
230 | 225 | |
@@ -234,16 +229,14 @@ discard block |
||
234 | 229 | * @param mixed $value |
235 | 230 | * @return void |
236 | 231 | */ |
237 | - public function offsetSet($key, $value) |
|
238 | - { |
|
232 | + public function offsetSet($key, $value) { |
|
239 | 233 | $this->set($key, $value); |
240 | 234 | } |
241 | 235 | |
242 | 236 | /** |
243 | 237 | * {@inheritdoc} |
244 | 238 | */ |
245 | - public function offsetUnset($key) |
|
246 | - { |
|
239 | + public function offsetUnset($key) { |
|
247 | 240 | $this->set($key, null); |
248 | 241 | } |
249 | 242 | |
@@ -292,8 +285,7 @@ discard block |
||
292 | 285 | * @param mixed $value |
293 | 286 | * @return mixed |
294 | 287 | */ |
295 | - protected function getFormattedConfigValue($value) |
|
296 | - { |
|
288 | + protected function getFormattedConfigValue($value) { |
|
297 | 289 | if (is_array($value) || is_object($value)) { |
298 | 290 | return serialize($value); |
299 | 291 | } |
@@ -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 |
@@ -105,7 +105,7 @@ |
||
105 | 105 | $this->queryBuilder = $queryBuilder; |
106 | 106 | |
107 | 107 | $this->setName('seed:createdb') |
108 | - ->setDescription('Create a new seed using existing data'); |
|
108 | + ->setDescription('Create a new seed using existing data'); |
|
109 | 109 | |
110 | 110 | $this->addArgument('table', 'name of the table', null, true, false); |
111 | 111 | $this->addArgument('name', 'name of seed', null, false, true); |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | * @template T |
64 | 64 | * @extends AbstractSeedCommand<T> |
65 | 65 | */ |
66 | -class SeedCreateDbCommand extends AbstractSeedCommand |
|
67 | -{ |
|
66 | +class SeedCreateDbCommand extends AbstractSeedCommand { |
|
68 | 67 | /** |
69 | 68 | * The seed name |
70 | 69 | * @var string |
@@ -114,8 +113,7 @@ discard block |
||
114 | 113 | /** |
115 | 114 | * {@inheritdoc} |
116 | 115 | */ |
117 | - public function execute() |
|
118 | - { |
|
116 | + public function execute() { |
|
119 | 117 | $writer = $this->io()->writer(); |
120 | 118 | |
121 | 119 | $this->table = $this->getArgumentValue('table'); |