No nested ternary operators

https://github.com/dseguy/clearPHP/blob/master/rules/no-nested-ternary.md

Signed-off-by: Marc Delisle <marc@infomarc.info>
This commit is contained in:
Marc Delisle 2015-12-02 09:19:33 -05:00
parent 4b4603cc6a
commit f4358bb74b

View File

@ -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;
}
}
/**