From f4358bb74b5b8db51ec5caf43fab7f08b2ce4337 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 2 Dec 2015 09:19:33 -0500 Subject: [PATCH] No nested ternary operators https://github.com/dseguy/clearPHP/blob/master/rules/no-nested-ternary.md Signed-off-by: Marc Delisle --- libraries/IndexColumn.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libraries/IndexColumn.php b/libraries/IndexColumn.php index e28699573c..2ca024b9db 100644 --- a/libraries/IndexColumn.php +++ b/libraries/IndexColumn.php @@ -136,9 +136,15 @@ class IndexColumn */ public function getNull($as_text = false) { - return $as_text - ? (!$this->_null || $this->_null == 'NO' ? __('No') : __('Yes')) - : $this->_null; + if ($as_text) { + if (!$this->_null || $this->_null == 'NO') { + return __('No'); + } else { + return __('Yes'); + } + } else { + return $this->_null; + } } /**