Passed
Pull Request — developer (#15456)
by Arkadiusz
20:21
created
app/TextParser.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -448,13 +448,13 @@  discard block
 block discarded – undo
448 448
 	public function parseData(string $content)
449 449
 	{
450 450
 		if ($this->useExtension) {
451
-			$content = preg_replace_callback('/<!--[\s]+({% [\s\S]+? %})[\s]+-->/u', function ($matches) {
451
+			$content = preg_replace_callback('/<!--[\s]+({% [\s\S]+? %})[\s]+-->/u', function($matches) {
452 452
 				return $matches[1] ?? '';
453 453
 			}, $content);
454 454
 			$twig = new \Twig\Environment(new \Twig\Loader\ArrayLoader(['index' => $content]));
455 455
 			$sandbox = new \Twig\Extension\SandboxExtension(\App\Extension\Twig\SecurityPolicy::getPolicy(), true);
456 456
 			$twig->addExtension($sandbox);
457
-			$twig->addFunction(new \Twig\TwigFunction('YFParser', function ($text) {
457
+			$twig->addFunction(new \Twig\TwigFunction('YFParser', function($text) {
458 458
 				$value = '';
459 459
 				preg_match(static::VARIABLE_REGEX, $text, $matches);
460 460
 				if ($matches) {
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 			}));
466 466
 			$content = $twig->render('index');
467 467
 		}
468
-		return preg_replace_callback(static::VARIABLE_REGEX, function ($matches) {
468
+		return preg_replace_callback(static::VARIABLE_REGEX, function($matches) {
469 469
 			[, $function, $params] = array_pad($matches, 3, '');
470 470
 			return \in_array($function, static::$baseFunctions) ? $this->{$function}($params) : '';
471 471
 		}, $content);
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 		if (isset($this->language)) {
482 482
 			Language::setTemporaryLanguage($this->language);
483 483
 		}
484
-		$this->content = preg_replace_callback('/\$\(translate : ([,"\+\%\.\=\-\[\]\&\w\s\|]+)\)\$/u', function ($matches) {
484
+		$this->content = preg_replace_callback('/\$\(translate : ([,"\+\%\.\=\-\[\]\&\w\s\|]+)\)\$/u', function($matches) {
485 485
 			[, $params] = array_pad($matches, 2, '');
486 486
 			return $this->translate($params);
487 487
 		}, $this->content);
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
 	public function getGeneralVariable()
1436 1436
 	{
1437 1437
 		$variables = [
1438
-			'LBL_ENTITY_VARIABLES' => array_map(function ($value) {
1438
+			'LBL_ENTITY_VARIABLES' => array_map(function($value) {
1439 1439
 				return Language::translate($value, 'Other.TextParser');
1440 1440
 			}, array_flip(static::$variableGeneral)),
1441 1441
 		];
@@ -1595,7 +1595,7 @@  discard block
 block discarded – undo
1595 1595
 			}
1596 1596
 		}
1597 1597
 		$generator = new \HTMLPurifier_Generator($config, new \HTMLPurifier_Context());
1598
-		$html = preg_replace_callback('/<*([A-Za-z_]\w*)\s\/>/', function ($matches) {
1598
+		$html = preg_replace_callback('/<*([A-Za-z_]\w*)\s\/>/', function($matches) {
1599 1599
 			if (\in_array($matches[1], ['div'])) {
1600 1600
 				return "<{$matches[1]}></{$matches[1]}>";
1601 1601
 			}
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
 			$customFieldClassSeq = 0;
1796 1796
 			foreach ($config['columns'] as $name) {
1797 1797
 				if (false !== strpos($name, '||')) {
1798
-					[$title,$value] = explode('||', $name, 2);
1798
+					[$title, $value] = explode('||', $name, 2);
1799 1799
 					if ('(' === $title[0] && ')' === substr($title, -1)) {
1800 1800
 						$title = $this->parseVariable("\${$title}\$");
1801 1801
 					}
Please login to merge, or discard this patch.
modules/Vtiger/views/Detail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1261,7 +1261,7 @@
 block discarded – undo
1261 1261
 		if (isset($history[$value]) && (!isset($locks[$fieldName]) || !\in_array($value, $locks[$fieldName]))) {
1262 1262
 			$history[$value]['time'] += \App\Fields\DateTime::getDiff($history[$value]['date'], date('Y-m-d H:i:s'), 'minutes');
1263 1263
 		}
1264
-		uasort($history, function ($a, $b) {
1264
+		uasort($history, function($a, $b) {
1265 1265
 			return strnatcmp($b['date'], $a['date']);
1266 1266
 		});
1267 1267
 		$viewer = $this->getViewer($request);
Please login to merge, or discard this patch.
api/webservice/Controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 	 */
72 72
 	public function preProcess(): bool
73 73
 	{
74
-		register_shutdown_function(function () {
74
+		register_shutdown_function(function() {
75 75
 			if ($error = error_get_last()) {
76 76
 				$this->errorHandler($error['type'], $error['message'], $error['file'], $error['line']);
77 77
 			}
Please login to merge, or discard this patch.
app/MeetingService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,13 +133,13 @@
 block discarded – undo
133 133
 	public function generateRoomName(string $prefix = ''): string
134 134
 	{
135 135
 		$prefix = preg_replace_callback_array([
136
-			'/[^a-z0-9 ]/' => function () {
136
+			'/[^a-z0-9 ]/' => function() {
137 137
 				return '';
138 138
 			},
139
-			'/\b[a-z]/' => function ($matches) {
139
+			'/\b[a-z]/' => function($matches) {
140 140
 				return mb_strtoupper($matches[0]);
141 141
 			},
142
-			'/[\s]/' => function () {
142
+			'/[\s]/' => function() {
143 143
 				return '';
144 144
 			},
145 145
 		], strtolower(\App\Utils::sanitizeSpecialChars($prefix, ' ')));
Please login to merge, or discard this patch.
modules/Calendar/views/RightPanel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 		}
56 56
 		if (!empty($users) && $favouriteUsers = $currentUser->getFavouritesUsers()) {
57 57
 			uksort($users,
58
-				function ($a, $b) use ($favouriteUsers) {
58
+				function($a, $b) use ($favouriteUsers) {
59 59
 					return (int) (!isset($favouriteUsers[$a]) && isset($favouriteUsers[$b]));
60 60
 				});
61 61
 			$viewer->assign('FAVOURITES_USERS', $favouriteUsers);
Please login to merge, or discard this patch.
app/QueryGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 			$subQuery->andHaving((new \yii\db\Expression('COUNT(1) > 1')));
967 967
 			$this->joins['duplicates'] = ['INNER JOIN', ['duplicates' => $subQuery], implode(' AND ', $duplicateCheckClause)];
968 968
 		}
969
-		uksort($this->joins, function ($a, $b) use ($moduleTableIndexList) {
969
+		uksort($this->joins, function($a, $b) use ($moduleTableIndexList) {
970 970
 			return (int) (!isset($moduleTableIndexList[$a]) && isset($moduleTableIndexList[$b]));
971 971
 		});
972 972
 		foreach ($this->joins as $join) {
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 			$searchParamsConditions['condition'] = $glueOrder[$key];
1363 1363
 			$searchParamsConditions['rules'] = [];
1364 1364
 			foreach ($conditions as $condition) {
1365
-				[$fieldName, , $sourceFieldName] = array_pad(explode(':', $condition[0]), 3, false);
1365
+				[$fieldName,, $sourceFieldName] = array_pad(explode(':', $condition[0]), 3, false);
1366 1366
 				if (!$sourceFieldName) {
1367 1367
 					$condition[0] = "{$fieldName}:{$this->getModule()}";
1368 1368
 				}
Please login to merge, or discard this patch.
modules/Vtiger/models/Module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -675,7 +675,7 @@
 block discarded – undo
675 675
 	{
676 676
 		$quickCreateFieldList = [];
677 677
 		foreach ($this->getFieldsByBlocks() as $blockFields) {
678
-			uksort($blockFields, function ($a, $b) use ($blockFields) {
678
+			uksort($blockFields, function($a, $b) use ($blockFields) {
679 679
 				if ($blockFields[$a]->get('quicksequence') === $blockFields[$b]->get('quicksequence')) {
680 680
 					return 0;
681 681
 				}
Please login to merge, or discard this patch.
vtlib/Vtiger/Link.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@
 block discarded – undo
185 185
 				if (self::IGNORE_MODULE === $tabid) {
186 186
 					$permittedTabIdList = \vtlib\Deprecated::getPermittedModuleIdList();
187 187
 					if (!empty($permittedTabIdList)) {
188
-						$permittedTabIdList[] = 0;  // Added to support one link for all modules
188
+						$permittedTabIdList[] = 0; // Added to support one link for all modules
189 189
 						foreach ($permittedTabIdList as $moduleId) {
190 190
 							foreach ($type as $typ) {
191 191
 								if (isset($rows[$moduleId][$typ])) {
Please login to merge, or discard this patch.
modules/Vtiger/models/ChartFilter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 		$colors = \App\Fields\Picklist::getColors($fieldName);
620 620
 		$this->colorsFrom = 'picklist';
621 621
 		$this->colorsFromRow = 'picklist_id';
622
-		$this->iterateAllRows(function ($row, $groupValue, $dividingValue, $rowIndex) use ($colors) {
622
+		$this->iterateAllRows(function($row, $groupValue, $dividingValue, $rowIndex) use ($colors) {
623 623
 			if (isset($colors[$row['picklist_id']])) {
624 624
 				$this->colors[$row['picklist_id']] = $colors[$row['picklist_id']];
625 625
 			}
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 		$this->colorsFrom = 'filters';
635 635
 		$this->colorsFromRow = 'color';
636 636
 		$colors = \App\Colors::getAllFilterColors();
637
-		$this->iterateAllRows(function (&$row, $groupValue, $dividingValue, $rowIndex) use ($colors) {
637
+		$this->iterateAllRows(function(&$row, $groupValue, $dividingValue, $rowIndex) use ($colors) {
638 638
 			$this->colors[$dividingValue] = $colors[$this->filterIds[$dividingValue]] ?? null;
639 639
 		});
640 640
 	}
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 	{
647 647
 		$this->colorsFrom = 'assigned_user_id';
648 648
 		$this->colorsFromRow = 'assigned_user_id';
649
-		$this->iterateAllRows(function ($row, $groupValue, $dividingValue, $rowIndex) {
649
+		$this->iterateAllRows(function($row, $groupValue, $dividingValue, $rowIndex) {
650 650
 			$this->colors[$row['assigned_user_id']] = \App\Fields\Owner::getColor($row['assigned_user_id']);
651 651
 		});
652 652
 	}
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 	{
659 659
 		$this->colorsFrom = 'record_id';
660 660
 		$this->colorsFromRow = 'id';
661
-		$this->iterateAllRows(function ($row, $groupValue, $dividingValue, $rowIndex) {
661
+		$this->iterateAllRows(function($row, $groupValue, $dividingValue, $rowIndex) {
662 662
 			$this->colors[$row['id']] = \App\Colors::getRandomColor('from_id_' . $row['id']);
663 663
 		});
664 664
 	}
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 	{
671 671
 		$this->colorsFrom = 'record_number';
672 672
 		$this->colorsFromRow = 'record_number';
673
-		$this->iterateAllRows(function ($row, $groupValue, $dividingValue, $rowIndex) {
673
+		$this->iterateAllRows(function($row, $groupValue, $dividingValue, $rowIndex) {
674 674
 			$this->colors[$groupValue] = \App\Colors::getRandomColor('generated_' . $groupValue);
675 675
 		});
676 676
 	}
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 					$firstReturnValueForSort = 1;
896 896
 					$secondReturnValueForSort = -1;
897 897
 				}
898
-				uksort($dataForSort, function ($a, $b) use ($dataForSort, $firstReturnValueForSort, $secondReturnValueForSort) {
898
+				uksort($dataForSort, function($a, $b) use ($dataForSort, $firstReturnValueForSort, $secondReturnValueForSort) {
899 899
 					if ($dataForSort[$a]['avg'] === $dataForSort[$b]['avg']) {
900 900
 						return 0;
901 901
 					}
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
 		$this->calculateAverage();
999 999
 		$this->normalizeData();
1000 1000
 		$this->setColorsFrom($this->findOutColorsFromRows());
1001
-		$this->iterateAllRows(function ($row, $groupValue, $dividingValue, $rowIndex) {
1001
+		$this->iterateAllRows(function($row, $groupValue, $dividingValue, $rowIndex) {
1002 1002
 			$this->setColorFromRow($row, $groupValue, $dividingValue);
1003 1003
 		});
1004 1004
 		return $this->data;
Please login to merge, or discard this patch.