@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | 'default' => 50, |
16 | 16 | 'description' => 'Max depth of hierarchy', |
17 | 17 | 'validation' => '\App\Validator::naturalNumber', |
18 | - 'sanitization' => function () { |
|
18 | + 'sanitization' => function() { |
|
19 | 19 | return (int) func_get_arg(0); |
20 | 20 | }, |
21 | 21 | ], |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | 'defaultViewName' => [ |
35 | 35 | 'default' => 'List', |
36 | 36 | 'description' => 'Default module view. Values: List, ListPreview, DashBoard or Tiles, refresh menu files after you change this value', |
37 | - 'validation' => function () { |
|
37 | + 'validation' => function() { |
|
38 | 38 | $arg = func_get_arg(0); |
39 | 39 | return 'List' === $arg || 'ListPreview' === $arg || 'DashBoard' === $arg || 'Tiles' === $arg; |
40 | 40 | }, |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | 'defaultDetailViewName' => [ |
43 | 43 | 'default' => 'full', |
44 | 44 | 'description' => 'Default record view for list preview. Values: full or summary', |
45 | - 'validation' => function () { |
|
45 | + 'validation' => function() { |
|
46 | 46 | $arg = func_get_arg(0); |
47 | 47 | return 'full' === $arg || 'summary' === $arg; |
48 | 48 | }, |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $separator = '-::~:~::~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~::~:~::-'; |
286 | 286 | $value = (string) $this->vcomponent->{$davName}; |
287 | 287 | if (false !== strpos($value, $separator)) { |
288 | - [$html,$text] = explode($separator, $value, 2); |
|
288 | + [$html, $text] = explode($separator, $value, 2); |
|
289 | 289 | $value = trim(strip_tags($html)) . "\n" . \trim(\str_replace($separator, '', $text)); |
290 | 290 | } else { |
291 | 291 | $value = trim(\str_replace('\n', PHP_EOL, $value)); |
@@ -448,14 +448,14 @@ discard block |
||
448 | 448 | $currentUser = \App\User::getCurrentUserModel(); |
449 | 449 | $userTimeZone = new \DateTimeZone($currentUser->getDetail('time_zone')); |
450 | 450 | $sysTimeZone = new \DateTimeZone(\App\Fields\DateTime::getTimeZone()); |
451 | - [$hour , $minute] = explode(':', $currentUser->getDetail('start_hour')); |
|
451 | + [$hour, $minute] = explode(':', $currentUser->getDetail('start_hour')); |
|
452 | 452 | $date = new \DateTime('now', $userTimeZone); |
453 | 453 | $date->setTime($hour, $minute); |
454 | 454 | $date->setTimezone($sysTimeZone); |
455 | 455 | $timeStart = $date->format('H:i:s'); |
456 | 456 | |
457 | 457 | $date->setTimezone($userTimeZone); |
458 | - [$hour , $minute] = explode(':', $currentUser->getDetail('end_hour')); |
|
458 | + [$hour, $minute] = explode(':', $currentUser->getDetail('end_hour')); |
|
459 | 459 | $date->setTime($hour, $minute); |
460 | 460 | $date->setTimezone($sysTimeZone); |
461 | 461 | $timeEnd = $date->format('H:i:s'); |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | $twig = new \Twig\Environment(new \Twig\Loader\ArrayLoader(['index' => $content])); |
466 | 466 | $sandbox = new \Twig\Extension\SandboxExtension(\App\Extension\Twig\SecurityPolicy::getPolicy(), true); |
467 | 467 | $twig->addExtension($sandbox); |
468 | - $twig->addFunction(new \Twig\TwigFunction('YFParser', function ($text) { |
|
468 | + $twig->addFunction(new \Twig\TwigFunction('YFParser', function($text) { |
|
469 | 469 | $value = ''; |
470 | 470 | preg_match(static::VARIABLE_REGEX, $text, $matches); |
471 | 471 | if ($matches) { |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | })); |
477 | 477 | $content = $twig->render('index'); |
478 | 478 | } |
479 | - return preg_replace_callback(static::VARIABLE_REGEX, function ($matches) { |
|
479 | + return preg_replace_callback(static::VARIABLE_REGEX, function($matches) { |
|
480 | 480 | [, $function, $params] = array_pad($matches, 3, ''); |
481 | 481 | return \in_array($function, static::$baseFunctions) ? $this->{$function}($params) : ''; |
482 | 482 | }, $content); |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | if (isset($this->language)) { |
493 | 493 | Language::setTemporaryLanguage($this->language); |
494 | 494 | } |
495 | - $this->content = preg_replace_callback('/\$\(translate : ([,"\+\%\.\=\-\[\]\&\w\s\|]+)\)\$/u', function ($matches) { |
|
495 | + $this->content = preg_replace_callback('/\$\(translate : ([,"\+\%\.\=\-\[\]\&\w\s\|]+)\)\$/u', function($matches) { |
|
496 | 496 | [, $params] = array_pad($matches, 2, ''); |
497 | 497 | return $this->translate($params); |
498 | 498 | }, $this->content); |
@@ -1852,7 +1852,7 @@ discard block |
||
1852 | 1852 | $width = isset($config['width']) ? preg_replace('/[^[:alnum:]]/', '', explode(',', $config['width'])) : []; |
1853 | 1853 | foreach ($config['columns'] as $key => $name) { |
1854 | 1854 | if (false !== strpos($name, '||')) { |
1855 | - [$title,$value] = explode('||', $name, 2); |
|
1855 | + [$title, $value] = explode('||', $name, 2); |
|
1856 | 1856 | if ('(' === $title[0] && ')' === substr($title, -1)) { |
1857 | 1857 | $title = $this->parseVariable("\${$title}\$"); |
1858 | 1858 | } |
@@ -150,7 +150,7 @@ |
||
150 | 150 | public function getFieldInstanceByName($name) |
151 | 151 | { |
152 | 152 | $moduleName = $this->getName(true); |
153 | - $params = ['uitype' => 7, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'I~M', 'presence' => 0, 'isEditableReadOnly' => false, 'maximumlength' => '', 'validator' => [['name' => 'NumberRange100']], 'source' => 'main']; |
|
153 | + $params = ['uitype' => 7, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'I~M', 'presence' => 0, 'isEditableReadOnly' => false, 'maximumlength' => '', 'validator' => [['name' => 'NumberRange100']], 'source' => 'main']; |
|
154 | 154 | switch ($name) { |
155 | 155 | case 'MAX_NUMBER_EXPORT_RECORDS': |
156 | 156 | $params['label'] = $this->performanceFields[$name]; |
@@ -79,7 +79,7 @@ |
||
79 | 79 | } |
80 | 80 | $customViewData['columnslist'] = $selectedColumnsList; |
81 | 81 | $customFieldNames = $request->getArray('customFieldNames', 'Text'); |
82 | - array_walk($customFieldNames, function (&$customLabel) { |
|
82 | + array_walk($customFieldNames, function(&$customLabel) { |
|
83 | 83 | $customLabel = \App\Purifier::decodeHtml(trim($customLabel)); |
84 | 84 | }); |
85 | 85 | $customViewData['customFieldNames'] = $customFieldNames; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public static function decodeCustomTag(string $text): string |
108 | 108 | { |
109 | 109 | if (false !== strpos($text, '<yetiforce')) { |
110 | - $text = preg_replace_callback('/<yetiforce\s(.*)><\/yetiforce>/', function (array $matches) { |
|
110 | + $text = preg_replace_callback('/<yetiforce\s(.*)><\/yetiforce>/', function(array $matches) { |
|
111 | 111 | $attributes = \App\TextUtils::getTagAttributes($matches[0]); |
112 | 112 | $return = ''; |
113 | 113 | if (!empty($attributes['type'])) { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | ); |
145 | 145 | return \preg_replace_callback( |
146 | 146 | static::ROW_REGEX, |
147 | - function (array $matches) { |
|
147 | + function(array $matches) { |
|
148 | 148 | $type = $matches[1]; |
149 | 149 | $id = (int) $matches[2]; |
150 | 150 | if (self::OWNER_SEPARATOR === $type) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | { |
203 | 203 | return \preg_replace_callback( |
204 | 204 | "/<a\\s+[^>]*data-id=(?:\"|')(.)(\\d+)(?:\"|')[^>]*>[^<]+<\\/a>/i", |
205 | - function (array $matches) { |
|
205 | + function(array $matches) { |
|
206 | 206 | $type = $matches[1]; |
207 | 207 | $recordName = strip_tags($matches[0]); |
208 | 208 | return "{$type}{$type}{$matches[2]}_{$recordName}{$type}{$type}"; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | 'BACKUP_PATH' => [ |
92 | 92 | 'default' => '', |
93 | 93 | 'description' => 'Backup catalog path.', |
94 | - 'validation' => function () { |
|
94 | + 'validation' => function() { |
|
95 | 95 | $arg = func_get_arg(0); |
96 | 96 | return '' === $arg || \App\Fields\File::isAllowedDirectory($arg); |
97 | 97 | }, |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | 'watchdogUrl' => [ |
204 | 204 | 'default' => '', |
205 | 205 | 'description' => 'YetiForce watchdog monitor URL', |
206 | - 'validation' => function () { |
|
206 | + 'validation' => function() { |
|
207 | 207 | $arg = func_get_arg(0); |
208 | 208 | return empty($arg) || \App\Validator::url($arg); |
209 | 209 | }, |
@@ -111,7 +111,7 @@ |
||
111 | 111 | foreach ($params as $key => $value) { |
112 | 112 | $textParser->setParam($key, $value); |
113 | 113 | } |
114 | - if ('Calendar' === $moduleName && !$recordModel->isEmpty('meeting_url') && !\array_key_exists('meetingUrl', $params) ) { |
|
114 | + if ('Calendar' === $moduleName && !$recordModel->isEmpty('meeting_url') && !\array_key_exists('meetingUrl', $params)) { |
|
115 | 115 | $textParser->setParam('meetingUrl', $recordModel->get('meeting_url')); |
116 | 116 | } |
117 | 117 | $subject = $textParser->setContent($templateModel->get('subject'))->parse()->getContent(); |
@@ -144,7 +144,7 @@ |
||
144 | 144 | $dataReader = (new App\Db\Query())->from('s_#__picklist_dependency_data')->where(['id' => $this->getId()])->createCommand()->query(); |
145 | 145 | $this->mapping = []; |
146 | 146 | while ($row = $dataReader->read()) { |
147 | - ['source_id' => $sourceId,'conditions' => $conditions] = $row; |
|
147 | + ['source_id' => $sourceId, 'conditions' => $conditions] = $row; |
|
148 | 148 | $this->mapping[$sourceId] = $conditions; |
149 | 149 | } |
150 | 150 | $dataReader->close(); |