Passed
Pull Request — developer (#16066)
by Arkadiusz
30:37 queued 13:08
created
modules/Vtiger/models/CalendarRightPanel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 		}
44 44
 		if (!empty($users) && $favoriteUsers = self::getFavoriteUsers($moduleName)) {
45 45
 			uksort($users,
46
-				function ($a, $b) use ($favoriteUsers) {
46
+				function($a, $b) use ($favoriteUsers) {
47 47
 					return (int) (!isset($favoriteUsers[$a]) && isset($favoriteUsers[$b]));
48 48
 				});
49 49
 		}
Please login to merge, or discard this patch.
config/ConfigTemplates.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 		'enabledServices' => [
11 11
 			'default' => [],
12 12
 			'description' => 'List of active services. Available: dav, webservice',
13
-			'validation' => function () {
13
+			'validation' => function() {
14 14
 				$arg = func_get_arg(0);
15 15
 				return \is_array($arg) && empty(array_diff($arg, ['dav', 'webservice']));
16 16
 			},
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		'AUTH_METHOD' => [
55 55
 			'default' => 'Basic',
56 56
 			'description' => 'Webservice config.',
57
-			'validation' => function () {
57
+			'validation' => function() {
58 58
 				return 'Basic' === func_get_arg(0);
59 59
 			},
60 60
 		],
@@ -102,18 +102,18 @@  discard block
 block discarded – undo
102 102
 		'upload_maxsize' => [
103 103
 			'default' => 52428800,
104 104
 			'description' => 'Maximum file size for uploaded files in bytes also used when uploading import files: upload_maxsize default value = 52428800 (50MB)',
105
-			'validation' => function () {
105
+			'validation' => function() {
106 106
 				$arg = func_get_arg(0);
107 107
 				return $arg && \App\Validator::naturalNumber($arg) && ($arg * 1048576) <= \App\Config::getMaxUploadSize(false);
108 108
 			},
109
-			'sanitization' => function () {
109
+			'sanitization' => function() {
110 110
 				return (int) func_get_arg(0) * 1048576;
111 111
 			},
112 112
 		],
113 113
 		'allow_exports' => [
114 114
 			'default' => 'all',
115 115
 			'description' => 'Flag to allow export functionality: "all" - to allow anyone to use exports, "admin" - to only allow admins to export, "none" -  to block exports completely',
116
-			'validation' => function () {
116
+			'validation' => function() {
117 117
 				$arg = func_get_arg(0);
118 118
 				return \in_array($arg, ['all', 'admin', 'none']);
119 119
 			},
@@ -125,18 +125,18 @@  discard block
 block discarded – undo
125 125
 		'list_max_entries_per_page' => [
126 126
 			'default' => 20,
127 127
 			'description' => 'List max entries per page: default value = 20',
128
-			'validation' => function () {
128
+			'validation' => function() {
129 129
 				$arg = func_get_arg(0);
130 130
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
131 131
 			},
132
-			'sanitization' => function () {
132
+			'sanitization' => function() {
133 133
 				return (int) func_get_arg(0);
134 134
 			},
135 135
 		],
136 136
 		'default_module' => [
137 137
 			'default' => 'Home',
138 138
 			'description' => 'Default module: default value = Home',
139
-			'validation' => function () {
139
+			'validation' => function() {
140 140
 				$arg = func_get_arg(0);
141 141
 				return true === \App\Module::isModuleActive($arg);
142 142
 			},
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		'default_charset' => [
145 145
 			'default' => 'UTF-8',
146 146
 			'description' => 'Default charset:  default value = "UTF-8"',
147
-			'validation' => function () {
147
+			'validation' => function() {
148 148
 				return 'UTF-8' === func_get_arg(0);
149 149
 			},
150 150
 		],
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
 		'application_unique_key' => [
157 157
 			'default' => sha1(time() + random_int(1, 9999999)),
158 158
 			'description' => 'Unique Application Key',
159
-			'validation' => function () {
159
+			'validation' => function() {
160 160
 				return !class_exists('\\Config\\Main');
161 161
 			},
162
-			'sanitization' => function () {
162
+			'sanitization' => function() {
163 163
 				return sha1(time() + random_int(1, 9999999));
164 164
 			},
165 165
 		],
166 166
 		'listview_max_textlength' => [
167 167
 			'default' => 40,
168 168
 			'description' => 'Trim descriptions, titles in listviews to this value',
169
-			'validation' => function () {
169
+			'validation' => function() {
170 170
 				$arg = func_get_arg(0);
171 171
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
172 172
 			},
173
-			'sanitization' => function () {
173
+			'sanitization' => function() {
174 174
 				return (int) func_get_arg(0);
175 175
 			},
176 176
 		],
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		'default_timezone' => [
182 182
 			'default' => '_TIMEZONE_',
183 183
 			'description' => 'Set the default timezone as per your preference',
184
-			'validation' => function () {
184
+			'validation' => function() {
185 185
 				$arg = func_get_arg(0);
186 186
 				return \in_array($arg, timezone_identifiers_list());
187 187
 			},
@@ -189,33 +189,33 @@  discard block
 block discarded – undo
189 189
 		'title_max_length' => [
190 190
 			'default' => 60,
191 191
 			'description' => 'Maximum length of characters for title',
192
-			'validation' => function () {
192
+			'validation' => function() {
193 193
 				$arg = func_get_arg(0);
194 194
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
195 195
 			},
196
-			'sanitization' => function () {
196
+			'sanitization' => function() {
197 197
 				return (int) func_get_arg(0);
198 198
 			},
199 199
 		],
200 200
 		'href_max_length' => [
201 201
 			'default' => 35,
202 202
 			'description' => 'Maximum length for href tag',
203
-			'validation' => function () {
203
+			'validation' => function() {
204 204
 				$arg = func_get_arg(0);
205 205
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
206 206
 			},
207
-			'sanitization' => function () {
207
+			'sanitization' => function() {
208 208
 				return (int) func_get_arg(0);
209 209
 			},
210 210
 		],
211 211
 		'MINIMUM_CRON_FREQUENCY' => [
212 212
 			'default' => 1,
213 213
 			'description' => 'Minimum cron frequency [min]',
214
-			'validation' => function () {
214
+			'validation' => function() {
215 215
 				$arg = func_get_arg(0);
216 216
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
217 217
 			},
218
-			'sanitization' => function () {
218
+			'sanitization' => function() {
219 219
 				return (int) func_get_arg(0);
220 220
 			},
221 221
 		],
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
 		'listMaxEntriesMassEdit' => [
232 232
 			'default' => 500,
233 233
 			'description' => 'Maximum number of records in a mass edition',
234
-			'validation' => function () {
234
+			'validation' => function() {
235 235
 				$arg = func_get_arg(0);
236 236
 				return $arg && \App\Validator::naturalNumber($arg) && (5000 >= $arg);
237 237
 			},
238
-			'sanitization' => function () {
238
+			'sanitization' => function() {
239 239
 				return (int) func_get_arg(0);
240 240
 			},
241 241
 		],
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 		'defaultLayout' => [
279 279
 			'default' => 'basic',
280 280
 			'description' => 'Set the default layout',
281
-			'validation' => function () {
281
+			'validation' => function() {
282 282
 				return isset(\App\Layout::getAllLayouts()[func_get_arg(0)]);
283 283
 			},
284 284
 		],
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		'phoneFieldAdvancedHrefFormat' => [
290 290
 			'default' => new \Nette\PhpGenerator\PhpLiteral('\libphonenumber\PhoneNumberFormat::RFC3966'),
291 291
 			'description' => "Phone number display format. Values:\nfalse - formatting is disabled \n\\libphonenumber\\PhoneNumberFormat::RFC3966 - +48-44-668-18-00\n\\libphonenumber\\PhoneNumberFormat::E164 - +48446681800 \n\\libphonenumber\\PhoneNumberFormat::INTERNATIONAL - 044 668 18 00\n\\libphonenumber\\PhoneNumberFormat::NATIONAL - +48 44 668 18 00",
292
-			'validation' => function () {
292
+			'validation' => function() {
293 293
 				return \in_array(func_get_arg(0), [
294 294
 					false,
295 295
 					\libphonenumber\PhoneNumberFormat::RFC3966,
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 		'LOG_LEVELS' => [
349 349
 			'default' => false,
350 350
 			'description' => 'Level of saved/displayed logs. Values: false = All / 3 = error and warning / ["error", "warning", "info", "trace", "profile"]',
351
-			'validation' => function () {
351
+			'validation' => function() {
352 352
 				$arg = func_get_arg(0);
353 353
 				return false === $arg || (\is_array($arg) && array_diff(['error', 'warning', 'info', 'trace', 'profile'], $arg));
354 354
 			},
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 		'SMARTY_ERROR_REPORTING' => [
430 430
 			'default' => new \Nette\PhpGenerator\PhpLiteral('E_ALL & ~E_NOTICE'),
431 431
 			'description' => 'Do not show Smarty Notice in phpError.log',
432
-			'validation' => function () {
432
+			'validation' => function() {
433 433
 				$arg = (string) func_get_arg(0);
434 434
 				return \in_array($arg, ['E_ALL', 'E_ALL & ~E_NOTICE']);
435 435
 			},
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 		'EXCEPTION_ERROR_LEVEL' => [
438 438
 			'default' => new \Nette\PhpGenerator\PhpLiteral('E_ALL & ~E_NOTICE'),
439 439
 			'description' => "Set the error reporting level. The parameter is either an integer representing a bit field, or named constants.\nhttps://secure.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting\nAll errors - E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED / Critical errors - E_ERROR | E_WARNING | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR",
440
-			'validation' => function () {
440
+			'validation' => function() {
441 441
 				$arg = (string) func_get_arg(0);
442 442
 				return \in_array($arg, ['E_ALL', 'E_ALL & ~E_NOTICE']);
443 443
 			},
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 		'CACHING_DRIVER' => [
610 610
 			'default' => 'Base',
611 611
 			'description' => 'Data caching is about storing some PHP variables in cache and retrieving it later from cache. Drivers: Base, Apcu',
612
-			'validation' => function () {
612
+			'validation' => function() {
613 613
 				$arg = func_get_arg(0);
614 614
 				return 'Basic' === $arg || 'Apcu' === $arg;
615 615
 			},
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 		'MODULES_SPLITTED_EDIT_VIEW_LAYOUT' => [
808 808
 			'default' => [],
809 809
 			'description' => 'List of modules with splitted edit view layout',
810
-			'validation' => function () {
810
+			'validation' => function() {
811 811
 				$arg = func_get_arg(0);
812 812
 				return \is_array($arg) && array_diff($arg, App\Module::getAllModuleNames());
813 813
 			},
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 			'default' => 20,
871 871
 			'description' => 'Maximum length of a comment visible in the related module',
872 872
 			'validation' => '\App\Validator::naturalNumber',
873
-			'sanitization' => function () {
873
+			'sanitization' => function() {
874 874
 				return (int) func_get_arg(0);
875 875
 			},
876 876
 		],
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 		'GLOBAL_SEARCH_SORTING_RESULTS' => [
921 921
 			'default' => 0,
922 922
 			'description' => 'Global search - Should the results be sorted in MySQL or PHP while displaying (None = 0, PHP = 1, Mysql = 2). The parameter impacts system efficiency.',
923
-			'validation' => function () {
923
+			'validation' => function() {
924 924
 				$arg = func_get_arg(0);
925 925
 				return \is_int($arg) && \in_array($arg, [0, 1, 2]);
926 926
 			},
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
 		'GLOBAL_SEARCH_AUTOCOMPLETE' => [
935 935
 			'default' => 1,
936 936
 			'description' => 'Global search - Search for records while entering text  (1/0).',
937
-			'validation' => function () {
937
+			'validation' => function() {
938 938
 				$arg = func_get_arg(0);
939 939
 				return \is_int($arg) && \in_array($arg, [0, 1]);
940 940
 			},
@@ -968,14 +968,14 @@  discard block
 block discarded – undo
968 968
 		'encryptionPass' => [
969 969
 			'default' => 'yeti',
970 970
 			'description' => 'Key to encrypt passwords, changing the key results in the loss of all encrypted data.',
971
-			'validation' => function () {
971
+			'validation' => function() {
972 972
 				return true;
973 973
 			},
974 974
 		],
975 975
 		'encryptionMethod' => [
976 976
 			'default' => 'aes-256-cbc',
977 977
 			'description' => 'Encryption method.',
978
-			'validation' => function () {
978
+			'validation' => function() {
979 979
 				$arg = func_get_arg(0);
980 980
 				return empty($arg) || ($arg && \in_array($arg, \App\Encryption::getMethods()));
981 981
 			},
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 		'permittedModulesByCreatorField' => [
1044 1044
 			'default' => [],
1045 1045
 			'description' => 'List of modules to which access is based on the record creation.',
1046
-			'validation' => function () {
1046
+			'validation' => function() {
1047 1047
 				$arg = func_get_arg(0);
1048 1048
 				return \is_array($arg) && array_diff($arg, App\Module::getAllModuleNames());
1049 1049
 			},
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 		'cookieForceHttpOnly' => [
1115 1115
 			'default' => true,
1116 1116
 			'description' => "Force the use of https only for cookie.\nValues: true, false, null",
1117
-			'validation' => function () {
1117
+			'validation' => function() {
1118 1118
 				$arg = func_get_arg(0);
1119 1119
 				return null === $arg ? $arg : \is_bool($arg);
1120 1120
 			},
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 		'USER_AUTHY_MODE' => [
1133 1133
 			'default' => 'TOTP_OPTIONAL',
1134 1134
 			'description' => "User authentication mode.\n\n@see \\Users_Totp_Authmethod::ALLOWED_USER_AUTHY_MODE\nAvailable values:\nTOTP_OFF - 2FA TOTP is checking off\nTOTP_OPTIONAL - It is defined by the user\nTOTP_OBLIGATORY - It is obligatory.",
1135
-			'validation' => function () {
1135
+			'validation' => function() {
1136 1136
 				$arg = func_get_arg(0);
1137 1137
 				return \in_array($arg, \Users_Totp_Authmethod::ALLOWED_USER_AUTHY_MODE);
1138 1138
 			},
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
 		'db_password' => [
1331 1331
 			'default' => '_DBC_PASS_',
1332 1332
 			'description' => 'Gets the database password',
1333
-			'validation' => function () {
1333
+			'validation' => function() {
1334 1334
 				return true;
1335 1335
 			},
1336 1336
 		],
Please login to merge, or discard this patch.
app/Components/InterestsConflict.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -315,7 +315,7 @@
 block discarded – undo
315 315
 		if (\App\Cache::has($cacheName, '')) {
316 316
 			return \App\Cache::get($cacheName, '');
317 317
 		}
318
-		$allModules = array_map(function ($v) {
318
+		$allModules = array_map(function($v) {
319 319
 			return 0 > $v ? 999 : sprintf('%03d', $v);
320 320
 		}, array_column(\vtlib\Functions::getAllModules(false, true), 'tabsequence', 'name'));
321 321
 		$excludedModules = ['ModComments'];
Please login to merge, or discard this patch.
app/Integrations/Dav/Calendar.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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');
Please login to merge, or discard this patch.
app/TextParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 					}
Please login to merge, or discard this patch.
modules/Vtiger/actions/QuickExportData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
 			$this->exportModel->setFields($fields);
83 83
 		} else {
84 84
 			$fields = \App\CustomView::getInstance($this->moduelName)->getColumnsListByCvid($cvId);
85
-			array_walk($fields, function (&$fieldInfo) {
85
+			array_walk($fields, function(&$fieldInfo) {
86 86
 				['field_name' => $relatedFieldName, 'module_name' => $relatedModule, 'source_field_name' => $referenceField] = $fieldInfo;
87 87
 				$fieldInfo = $referenceField ? "{$relatedFieldName}:{$relatedModule}:{$referenceField}" : $relatedFieldName;
88 88
 			});
Please login to merge, or discard this patch.
modules/Settings/ConfigEditor/models/Module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@
 block discarded – undo
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];
Please login to merge, or discard this patch.