Skip to content

Commit

Permalink
Fix PHPStorm warnings in category_api.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Sep 23, 2020
1 parent dd86c9c commit 6b9160e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/category_api.php
Expand Up @@ -303,7 +303,7 @@ function category_remove_all( $p_project_id, $p_new_category_id = 0 ) {
* Return the definition row for the category
* @param integer $p_category_id Category identifier.
* @param boolean $p_error_if_not_exists true: error if not exists, otherwise return false.
* @return array An array containing category details.
* @return array|false An array containing category details.
* @access public
*/
function category_get_row( $p_category_id, $p_error_if_not_exists = true ) {
Expand Down Expand Up @@ -404,7 +404,6 @@ function category_cache_array_rows_by_project( array $p_project_id_array ) {
foreach( $t_rows as $t_project_id => $t_row ) {
$g_cache_category_project[(int)$t_project_id] = $t_row;
}
return;
}

/**
Expand Down Expand Up @@ -463,6 +462,7 @@ function category_get_all_rows( $p_project_id, $p_inherit = null, $p_sort_by_pro
global $g_category_cache, $g_cache_category_project;

if( isset( $g_cache_category_project[(int)$p_project_id] ) ) {
$t_categories = array();
if( !empty( $g_cache_category_project[(int)$p_project_id]) ) {
foreach( $g_cache_category_project[(int)$p_project_id] as $t_id ) {
$t_categories[] = category_get_row( $t_id );
Expand All @@ -473,10 +473,8 @@ function category_get_all_rows( $p_project_id, $p_inherit = null, $p_sort_by_pro
usort( $t_categories, 'category_sort_rows_by_project' );
category_sort_rows_by_project( null );
}
return $t_categories;
} else {
return array();
}
return $t_categories;
}

$c_project_id = (int)$p_project_id;
Expand Down Expand Up @@ -547,7 +545,6 @@ function category_cache_array_rows( array $p_cat_id_array ) {
while( $t_row = db_fetch_array( $t_result ) ) {
$g_category_cache[(int)$t_row['id']] = $t_row;
}
return;
}

/**
Expand Down

0 comments on commit 6b9160e

Please sign in to comment.