diff options
author | Thomas Lange <code@nerdmind.de> | 2017-05-17 19:06:50 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2017-05-17 19:06:50 +0200 |
commit | 6b4faa47d02094d3f9fe637fc83431e7c49004cd (patch) | |
tree | 97981ab102301a6b70947b692abb5e2c27611ba5 | |
parent | d6d0d9fa8ed37109edde4f52a7db4c5a288ee711 (diff) | |
download | blog-6b4faa47d02094d3f9fe637fc83431e7c49004cd.tar.gz blog-6b4faa47d02094d3f9fe637fc83431e7c49004cd.tar.xz blog-6b4faa47d02094d3f9fe637fc83431e7c49004cd.zip |
Explicit types for return values and function parameters added.
-rw-r--r-- | core/functions.php | 12 |
1 files 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 |