From 89c6efdf8c32aeb4aa8b7768787db07c1e07526f Mon Sep 17 00:00:00 2001 From: Daniel Opitz Date: Thu, 29 Aug 2024 18:26:30 +0200 Subject: [PATCH] Update readme (#112) * Update readme. Fixes #110 * Update gitignore --- .gitignore | 21 ++++++++++++++++----- README.md | 4 ++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 78f83f7..d1e4bf6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,18 @@ -.DS_Store +# Composer composer.lock -vendor -.idea -composer.phar +/vendor + +# PHPUnit +/.phpunit.cache .phpunit.result.cache -build/ \ No newline at end of file + +# IDEs +/.fleet +/.idea +/.vscode + +# Build artifacts and temporary files +.DS_Store +clover.xml +/build +/coverage diff --git a/README.md b/README.md index 2bf515c..6c90e00 100644 --- a/README.md +++ b/README.md @@ -183,9 +183,9 @@ The following function uses the `htmlspecialchars` function with specific flags to ensure proper encoding: ```php -function html(string $text = null): string +function html(?string $text = null): string { - return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + return htmlspecialchars($text ?? '', ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); } ```