From 6b4faa47d02094d3f9fe637fc83431e7c49004cd Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 17 May 2017 19:06:50 +0200 Subject: Explicit types for return values and function parameters added. --- core/functions.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/functions.php b/core/functions.php index fc97e3b..ccaf008 100644 --- a/core/functions.php +++ b/core/functions.php @@ -351,36 +351,36 @@ function makeSlugURL($string, $separator = '-') { #=============================================================================== # Function to get data from specific page in templates #=============================================================================== -function PAGE($id) { +function PAGE(int $id): array { try { $Page = Page\Factory::build($id); return generatePageItemData($Page); } catch(Page\Exception $Exception) { - return NULL; + return []; } } #=============================================================================== # Function to get data from specific post in templates #=============================================================================== -function POST($id) { +function POST(int $id): array { try { $Post = Post\Factory::build($id); return generatePostItemData($Post); } catch(Post\Exception $Exception) { - return NULL; + return []; } } #=============================================================================== # Function to get data from specific user in templates #=============================================================================== -function USER($id) { +function USER(int $id): array { try { $User = User\Factory::build($id); return generateUserItemData($User); } catch(User\Exception $Exception) { - return NULL; + return []; } } ?> \ No newline at end of file -- cgit v1.2.3