@@ -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 | } |
@@ -106,8 +104,7 @@ discard block |
||
106 | 104 | * @param array<string, mixed> $filters the filters to use if any |
107 | 105 | * @return mixed |
108 | 106 | */ |
109 | - public function get(string $key, $default = null, array $filters = []) |
|
110 | - { |
|
107 | + public function get(string $key, $default = null, array $filters = []) { |
|
111 | 108 | $results = $this->parseKey($key); |
112 | 109 | $group = $results['group']; |
113 | 110 | |
@@ -216,16 +213,14 @@ discard block |
||
216 | 213 | /** |
217 | 214 | * {@inheritdoc} |
218 | 215 | */ |
219 | - public function offsetExists($key) |
|
220 | - { |
|
216 | + public function offsetExists($key) { |
|
221 | 217 | return $this->has($key); |
222 | 218 | } |
223 | 219 | |
224 | 220 | /** |
225 | 221 | * {@inheritdoc} |
226 | 222 | */ |
227 | - public function offsetGet($key) |
|
228 | - { |
|
223 | + public function offsetGet($key) { |
|
229 | 224 | return $this->get($key); |
230 | 225 | } |
231 | 226 | |
@@ -235,16 +230,14 @@ discard block |
||
235 | 230 | * @param mixed $value |
236 | 231 | * @return void |
237 | 232 | */ |
238 | - public function offsetSet($key, $value) |
|
239 | - { |
|
233 | + public function offsetSet($key, $value) { |
|
240 | 234 | $this->set($key, $value); |
241 | 235 | } |
242 | 236 | |
243 | 237 | /** |
244 | 238 | * {@inheritdoc} |
245 | 239 | */ |
246 | - public function offsetUnset($key) |
|
247 | - { |
|
240 | + public function offsetUnset($key) { |
|
248 | 241 | $this->set($key, null); |
249 | 242 | } |
250 | 243 | |
@@ -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 |
@@ -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'); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | ) { |
81 | 81 | parent::__construct($app, $config, $filesystem); |
82 | 82 | $this->setName('seed:create') |
83 | - ->setDescription('Create a new seed'); |
|
83 | + ->setDescription('Create a new seed'); |
|
84 | 84 | |
85 | 85 | $this->addArgument('name', 'name of seed', null, false, true); |
86 | 86 | } |
@@ -61,8 +61,7 @@ discard block |
||
61 | 61 | * @template T |
62 | 62 | * @extends AbstractSeedCommand<T> |
63 | 63 | */ |
64 | -class SeedCreateCommand extends AbstractSeedCommand |
|
65 | -{ |
|
64 | +class SeedCreateCommand extends AbstractSeedCommand { |
|
66 | 65 | /** |
67 | 66 | * The seed name |
68 | 67 | * @var string |
@@ -88,8 +87,7 @@ discard block |
||
88 | 87 | /** |
89 | 88 | * {@inheritdoc} |
90 | 89 | */ |
91 | - public function execute() |
|
92 | - { |
|
90 | + public function execute() { |
|
93 | 91 | $writer = $this->io()->writer(); |
94 | 92 | |
95 | 93 | $version = date('Ymd_His'); |