Skip to content

Commit

Permalink
fix: unecessary ternery
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane-2pi committed Feb 16, 2022
1 parent a9094de commit 4522dbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/modules/task/partials/actions/listtasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function listtasks(\Web $w, $params = array())
$w->ctx("redirect", $params['redirect']);

$w->ctx("hide_filter", array_key_exists('hide_filter', $params) ? $params['hide_filter'] : false);
$w->ctx("hide_columns", array_key_exists('columns_to_hide', $params)? true : false);
$w->ctx("hide_columns", array_key_exists('columns_to_hide', $params));

This comment has been minimized.

Copy link
@careck

careck Feb 16, 2022

Member

if you wanted to be super extra safe, then you could also check whether the array is not empty, eg:

array_key_exists('columns_to_hide', $params) && !empty($params['columns_to_hide'])

$w->ctx("columns_to_hide", array_key_exists('columns_to_hide', $params)? $params['columns_to_hide'] : []);

$taskgroup = null;
Expand Down

0 comments on commit 4522dbe

Please sign in to comment.