From b956e6f1b7408ff83d405814d8211665900469f7 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 30 Apr 2020 21:37:31 +0200 Subject: [PATCH] add multiline ternary --- standards/general.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/standards/general.md b/standards/general.md index 60c9a1d..75221e5 100644 --- a/standards/general.md +++ b/standards/general.md @@ -119,6 +119,15 @@ if (...) { $result = condition ? expr1 : expr2; ``` +Multiline ternary expressions should be indented. + + +```php +$result = condition + ? very long expr1 which should be written like this + : very long expr2 which should be written like this; +``` + Multiline `if` conditions should begin with a logical opperator `or`/`and`. ```php