Skip to content
Extraits de code Groupes Projets
Valider c9e7e3fd rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

make sure to not end in a never ending loop

parent 01a93308
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -25,7 +25,7 @@ class ExceptionHandler ...@@ -25,7 +25,7 @@ class ExceptionHandler
} }
/** /**
* @param Exception $exception * @param Exception|\Throwable $exception
*/ */
public static function handleException($exception) public static function handleException($exception)
{ {
...@@ -37,7 +37,7 @@ class ExceptionHandler ...@@ -37,7 +37,7 @@ class ExceptionHandler
} }
/** /**
* @param Exception $exception * @param Exception|\Throwable $exception
*/ */
public static function dieWithCliError($exception) public static function dieWithCliError($exception)
{ {
...@@ -61,7 +61,7 @@ class ExceptionHandler ...@@ -61,7 +61,7 @@ class ExceptionHandler
} }
/** /**
* @param Exception $exception * @param Exception|\Throwable $exception
*/ */
public static function dieWithHtmlErrorPage($exception) public static function dieWithHtmlErrorPage($exception)
{ {
...@@ -73,7 +73,7 @@ class ExceptionHandler ...@@ -73,7 +73,7 @@ class ExceptionHandler
} }
/** /**
* @param Exception $ex * @param Exception|\Throwable $ex
*/ */
private static function getErrorResponse($ex) private static function getErrorResponse($ex)
{ {
......
...@@ -354,7 +354,15 @@ abstract class VisitDimension extends Dimension ...@@ -354,7 +354,15 @@ abstract class VisitDimension extends Dimension
} }
} }
$count = 0;
while (count($dimensions) > 0) { while (count($dimensions) > 0) {
$count++;
if ($count > 1000) {
foreach ($dimensions as $dimension) {
$sorted[] = $dimension;
}
break; // to prevent an endless loop
}
foreach ($dimensions as $key => $dimension) { foreach ($dimensions as $key => $dimension) {
$fields = $depenencies[$dimension->getColumnName()]; $fields = $depenencies[$dimension->getColumnName()];
if (count(array_intersect($fields, $exists)) === count($fields)) { if (count(array_intersect($fields, $exists)) === count($fields)) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter