diff options
author | Thomas Lange <code@nerdmind.de> | 2024-12-01 18:09:09 +0100 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2024-12-01 19:50:22 +0100 |
commit | 2ac4bdca2ab38990f891371282a3a17af290e78f (patch) | |
tree | 4383257740b3a4ae1800ac989d24234eefc0d8c2 /core/functions.php | |
parent | ebc5cf9ac20b959c6d4a6a34643eb8657cf9db84 (diff) | |
download | blog-2ac4bdca2ab38990f891371282a3a17af290e78f.tar.gz blog-2ac4bdca2ab38990f891371282a3a17af290e78f.tar.xz blog-2ac4bdca2ab38990f891371282a3a17af290e78f.zip |
PHP Keywords and types should be in lowercase
Follow PSR-12 and use lowercase variants of PHP reserved keywords.
See: https://www.php-fig.org/psr/psr-12/#25-keywords-and-types
Find all uppercase occurrences of "or", "and", "null", "true" and
"false" and change them to the lowercase variant.
Diffstat (limited to 'core/functions.php')
-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 15a5318..ffc1e1c 100644 --- a/core/functions.php +++ b/core/functions.php @@ -32,7 +32,7 @@ function createPaginationTemplate($current, $last, string $location): Template { #=============================================================================== # Helper function to reduce duplicate code #=============================================================================== -function generateCategoryItemTemplate(Category $Category, bool $is_root = FALSE): Template { +function generateCategoryItemTemplate(Category $Category, bool $is_root = false): Template { $CategoryRepository = Application::getRepository('Category'); foreach($CategoryRepository->findWithParents($Category->getID()) as $Category) { @@ -121,8 +121,8 @@ function generateItemTemplateData(EntityInterface $Entity): array { 'ARGV' => $arguments, 'ATTR' => $attribute, - 'PREV' => FALSE, - 'NEXT' => FALSE, + 'PREV' => false, + 'NEXT' => false, 'FILE' => [ 'LIST' => $images, @@ -292,7 +292,7 @@ function generateSlug($string, $separator = '-') { #=========================================================================== # Callback for (CATEGORY|PAGE|POST|USER) content function #=========================================================================== -function getEntityMarkdownLink($ns, $id, $text = NULL, $info = NULL): string { +function getEntityMarkdownLink($ns, $id, $text = null, $info = null): string { if(!$Entity = Application::getRepository($ns)->find($id)) { return sprintf('`{%s: *Reference error*}`', strtoupper($ns)); } @@ -301,7 +301,7 @@ function getEntityMarkdownLink($ns, $id, $text = NULL, $info = NULL): string { $href = Application::getEntityURL($Entity); $text = $text ?: "»{$title}«"; - if($info === NULL) { + if($info === null) { $info = sprintf('%s »%s«', Application::getLanguage()->text(strtolower($ns)), $title); @@ -399,7 +399,7 @@ foreach(['CATEGORY', 'PAGE', 'POST', 'USER'] as $function) { // Get Markdown formatted entity link Application::addContentFunction($function, - function($id, $text = NULL, $title = NULL) use($entity) { + function($id, $text = null, $title = null) use($entity) { return getEntityMarkdownLink($entity, $id, $text, $title); }); |