@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | return [ |
| 53 | 53 | Request::class => create(Request::class) |
| 54 | 54 | ->constructor(\Klein\Request::createFromGlobals()), |
| 55 | - ContextInterface::class => function (ContainerInterface $c) { |
|
| 55 | + ContextInterface::class => function(ContainerInterface $c) { |
|
| 56 | 56 | switch (APP_MODULE) { |
| 57 | 57 | case 'web': |
| 58 | 58 | return $c->get(SessionContext::class); |
@@ -60,24 +60,24 @@ discard block |
||
| 60 | 60 | return $c->get(StatelessContext::class); |
| 61 | 61 | } |
| 62 | 62 | }, |
| 63 | - Config::class => function (ContainerInterface $c) { |
|
| 63 | + Config::class => function(ContainerInterface $c) { |
|
| 64 | 64 | return new Config( |
| 65 | 65 | new XmlHandler(new FileHandler(CONFIG_FILE)), |
| 66 | 66 | new FileCache(Config::CONFIG_CACHE_FILE), |
| 67 | 67 | $c); |
| 68 | 68 | }, |
| 69 | - ConfigData::class => function (Config $config) { |
|
| 69 | + ConfigData::class => function(Config $config) { |
|
| 70 | 70 | return $config->getConfigData(); |
| 71 | 71 | }, |
| 72 | 72 | DBStorageInterface::class => create(MySQLHandler::class) |
| 73 | 73 | ->constructor(factory([DatabaseConnectionData::class, 'getFromConfig'])), |
| 74 | - Actions::class => function (ContainerInterface $c) { |
|
| 74 | + Actions::class => function(ContainerInterface $c) { |
|
| 75 | 75 | return new Actions( |
| 76 | 76 | new FileCache(Actions::ACTIONS_CACHE_FILE), |
| 77 | 77 | new XmlHandler(new FileHandler(ACTIONS_FILE)) |
| 78 | 78 | ); |
| 79 | 79 | }, |
| 80 | - MimeTypes::class => function () { |
|
| 80 | + MimeTypes::class => function() { |
|
| 81 | 81 | return new MimeTypes( |
| 82 | 82 | new FileCache(MimeTypes::MIME_CACHE_FILE), |
| 83 | 83 | new XmlHandler(new FileHandler(MIMETYPES_FILE)) |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $customFieldType[$customFieldTypeData->getName()] = $customFieldTypeData->getId(); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $this->transactionAware(function () use ($customFieldType) { |
|
| 74 | + $this->transactionAware(function() use ($customFieldType) { |
|
| 75 | 75 | $customFieldDefService = $this->dic->get(CustomFieldDefService::class); |
| 76 | 76 | |
| 77 | 77 | $queryData = new QueryData(); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | ); |
| 175 | 175 | |
| 176 | 176 | try { |
| 177 | - $this->transactionAware(function () { |
|
| 177 | + $this->transactionAware(function() { |
|
| 178 | 178 | $customFieldDefService = $this->dic->get(CustomFieldDefService::class); |
| 179 | 179 | |
| 180 | 180 | foreach ($customFieldDefService->getAllBasic() as $item) { |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $customFieldType[$customFieldTypeData->getName()] = $customFieldTypeData->getId(); |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - $this->transactionAware(function () use ($customFieldType) { |
|
| 235 | + $this->transactionAware(function() use ($customFieldType) { |
|
| 236 | 236 | $queryData = new QueryData(); |
| 237 | 237 | $queryData->setQuery('SELECT id, field FROM CustomFieldDefinition WHERE field IS NOT NULL'); |
| 238 | 238 | |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | */ |
| 431 | 431 | public function update(AccountRequest $accountRequest) |
| 432 | 432 | { |
| 433 | - $this->transactionAware(function () use ($accountRequest) { |
|
| 433 | + $this->transactionAware(function() use ($accountRequest) { |
|
| 434 | 434 | $userData = $this->context->getUserData(); |
| 435 | 435 | $userProfile = $this->context->getUserProfile(); |
| 436 | 436 | |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | */ |
| 553 | 553 | public function updateBulk(AccountBulkRequest $request) |
| 554 | 554 | { |
| 555 | - $this->transactionAware(function () use ($request) { |
|
| 555 | + $this->transactionAware(function() use ($request) { |
|
| 556 | 556 | foreach ($request->getItemsId() as $itemId) { |
| 557 | 557 | $accountRequest = $request->getAccountRequestForId($itemId); |
| 558 | 558 | |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | */ |
| 573 | 573 | public function editPassword(AccountRequest $accountRequest) |
| 574 | 574 | { |
| 575 | - $this->transactionAware(function () use ($accountRequest) { |
|
| 575 | + $this->transactionAware(function() use ($accountRequest) { |
|
| 576 | 576 | $this->addHistory($accountRequest->id); |
| 577 | 577 | |
| 578 | 578 | $pass = $this->getPasswordEncrypted($accountRequest->pass); |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | */ |
| 607 | 607 | public function editRestore($historyId, $accountId) |
| 608 | 608 | { |
| 609 | - $this->transactionAware(function () use ($historyId, $accountId) { |
|
| 609 | + $this->transactionAware(function() use ($historyId, $accountId) { |
|
| 610 | 610 | $this->addHistory($accountId); |
| 611 | 611 | |
| 612 | 612 | if (!$this->accountRepository->editRestore($historyId, $this->context->getUserData()->getId())) { |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | */ |
| 624 | 624 | public function delete($id) |
| 625 | 625 | { |
| 626 | - $this->transactionAware(function () use ($id) { |
|
| 626 | + $this->transactionAware(function() use ($id) { |
|
| 627 | 627 | $this->addHistory($id, 1); |
| 628 | 628 | |
| 629 | 629 | if ($this->accountRepository->delete($id) === 0) { |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | ); |
| 248 | 248 | |
| 249 | 249 | if (!empty($filtersAndValues)) { |
| 250 | - $filtersItem = array_filter($filtersAndValues, function ($value, $key) { |
|
| 250 | + $filtersItem = array_filter($filtersAndValues, function($value, $key) { |
|
| 251 | 251 | return in_array($key, self::FILTERS['items']['subject'], true) |
| 252 | 252 | && $value !== ''; |
| 253 | 253 | }, ARRAY_FILTER_USE_BOTH); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $this->processFilterItems($filtersItem, $queryCondition); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - $filtersOperator = array_filter($filtersAndValues, function ($value, $key) { |
|
| 259 | + $filtersOperator = array_filter($filtersAndValues, function($value, $key) { |
|
| 260 | 260 | return in_array($key, self::FILTERS['operator']['subject'], true) |
| 261 | 261 | && in_array($value, self::FILTERS['operator']['condition'], true); |
| 262 | 262 | }, ARRAY_FILTER_USE_BOTH); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $this->processFilterOperator($filtersOperator); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - $filtersCondition = array_filter(array_map(function ($subject, $condition) { |
|
| 268 | + $filtersCondition = array_filter(array_map(function($subject, $condition) { |
|
| 269 | 269 | if (in_array($subject, self::FILTERS['condition']['subject'], true) |
| 270 | 270 | && in_array($condition, self::FILTERS['condition']['condition'], true) |
| 271 | 271 | ) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | protected function processCategories() |
| 193 | 193 | { |
| 194 | 194 | $this->getNodesData('Categories', 'Category', |
| 195 | - function (DOMElement $category) { |
|
| 195 | + function(DOMElement $category) { |
|
| 196 | 196 | $categoryData = new CategoryData(); |
| 197 | 197 | |
| 198 | 198 | foreach ($category->childNodes as $node) { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | protected function processClients() |
| 232 | 232 | { |
| 233 | 233 | $this->getNodesData('Clients', 'Client', |
| 234 | - function (DOMElement $client) { |
|
| 234 | + function(DOMElement $client) { |
|
| 235 | 235 | $clientData = new ClientData(); |
| 236 | 236 | |
| 237 | 237 | foreach ($client->childNodes as $node) { |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | protected function processCustomers() |
| 272 | 272 | { |
| 273 | 273 | $this->getNodesData('Customers', 'Customer', |
| 274 | - function (DOMElement $client) { |
|
| 274 | + function(DOMElement $client) { |
|
| 275 | 275 | $clientData = new ClientData(); |
| 276 | 276 | |
| 277 | 277 | foreach ($client->childNodes as $node) { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | protected function processTags() |
| 311 | 311 | { |
| 312 | 312 | $this->getNodesData('Tags', 'Tag', |
| 313 | - function (DOMElement $tag) { |
|
| 313 | + function(DOMElement $tag) { |
|
| 314 | 314 | $tagData = new TagData(); |
| 315 | 315 | |
| 316 | 316 | foreach ($tag->childNodes as $node) { |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | protected function processAccounts() |
| 347 | 347 | { |
| 348 | 348 | $this->getNodesData('Accounts', 'Account', |
| 349 | - function (DOMElement $account) { |
|
| 349 | + function(DOMElement $account) { |
|
| 350 | 350 | $accountRequest = new AccountRequest(); |
| 351 | 351 | |
| 352 | 352 | /** @var DOMElement $node */ |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | $data = $result->getDataAsArray(); |
| 131 | 131 | |
| 132 | - array_walk($data, function ($itemData) { |
|
| 132 | + array_walk($data, function($itemData) { |
|
| 133 | 133 | /** @var PluginDataModel $itemData */ |
| 134 | 134 | $itemData->decrypt($this->getMasterKeyFromContext()); |
| 135 | 135 | }); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | $data = $this->pluginRepository->getAll()->getDataAsArray(); |
| 150 | 150 | |
| 151 | - array_walk($data, function ($itemData) { |
|
| 151 | + array_walk($data, function($itemData) { |
|
| 152 | 152 | /** @var PluginDataModel $itemData */ |
| 153 | 153 | $itemData->decrypt($this->getMasterKeyFromContext()); |
| 154 | 154 | }); |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | $sk = $this->vars->get('sk'); |
| 363 | 363 | |
| 364 | 364 | // An anonymous proxy function for handling views variables |
| 365 | - $_getvar = function ($key, $default = null) { |
|
| 365 | + $_getvar = function($key, $default = null) { |
|
| 366 | 366 | if (DEBUG && !$this->vars->exists($key)) { |
| 367 | 367 | logger(sprintf(__('Unable to retrieve "%s" variable'), $key), 'WARN'); |
| 368 | 368 | |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | return $this->vars->get($key, $default); |
| 373 | 373 | }; |
| 374 | 374 | |
| 375 | - $_getRoute = function ($path) use ($sk, $configData) { |
|
| 375 | + $_getRoute = function($path) use ($sk, $configData) { |
|
| 376 | 376 | $baseUrl = ($configData->getApplicationUrl() ?: Bootstrap::$WEBURI) . Bootstrap::$SUBURI; |
| 377 | 377 | |
| 378 | 378 | $uri = new Uri($baseUrl); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $oops = "Oops, it looks like this content does not exist..."; |
| 141 | 141 | |
| 142 | - $this->router->onError(function ($router, $err_msg, $type, $err) { |
|
| 142 | + $this->router->onError(function($router, $err_msg, $type, $err) { |
|
| 143 | 143 | logger('Routing error: ' . $err_msg); |
| 144 | 144 | |
| 145 | 145 | /** @var Exception|Throwable $err */ |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | // Manage requests for api module |
| 153 | 153 | $this->router->respond(['POST'], |
| 154 | 154 | '@/api\.php', |
| 155 | - function ($request, $response, $service) use ($oops) { |
|
| 155 | + function($request, $response, $service) use ($oops) { |
|
| 156 | 156 | try { |
| 157 | 157 | logger('API route'); |
| 158 | 158 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // Manage requests for web module |
| 196 | 196 | $this->router->respond(['GET', 'POST'], |
| 197 | 197 | '@(?!/api\.php)', |
| 198 | - function ($request, $response, $service) use ($oops) { |
|
| 198 | + function($request, $response, $service) use ($oops) { |
|
| 199 | 199 | try { |
| 200 | 200 | logger('WEB route'); |
| 201 | 201 | |
@@ -58,9 +58,9 @@ |
||
| 58 | 58 | * @param bool $render |
| 59 | 59 | */ |
| 60 | 60 | public static function showExceptionInView(Template $view, |
| 61 | - Exception $e, |
|
| 62 | - $replace = null, |
|
| 63 | - $render = true) |
|
| 61 | + Exception $e, |
|
| 62 | + $replace = null, |
|
| 63 | + $render = true) |
|
| 64 | 64 | { |
| 65 | 65 | switch (get_class($e)) { |
| 66 | 66 | case UpdatedMasterPassException::class: |