diff --git a/src/Builder/ConfigurationEnvironmentBuilder/ArrayConfigurationEnvironmentStrategy.php b/src/Builder/ConfigurationEnvironmentBuilder/ArrayConfigurationEnvironmentStrategy.php index cd961eeb..e8c766ef 100644 --- a/src/Builder/ConfigurationEnvironmentBuilder/ArrayConfigurationEnvironmentStrategy.php +++ b/src/Builder/ConfigurationEnvironmentBuilder/ArrayConfigurationEnvironmentStrategy.php @@ -80,7 +80,17 @@ protected function createIndent(int $level): string */ protected function isComplicatedExpression(string $expression): bool { - return (bool)preg_match('/[\(\)\?]/', $expression) || $this->isClassIdentifier($expression); + return $this->hasComparison($expression) || $this->isClassIdentifier($expression); + } + + /** + * @param string $expression + * + * @return bool + */ + protected function hasComparison(string $expression): bool + { + return (bool)preg_match('/if\(.+\)\{|\?.+:/', $expression); } /**