From b447c0772cd3f9b4662f0f9e7f0ad11eebee643a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 26 Nov 2023 21:26:16 +0000 Subject: [PATCH] Static classes --- Utils/Encoding/Base64Url.php | 10 ++++++++++ Utils/Encoding/Caesar.php | 10 ++++++++++ Utils/Encoding/Gray.php | 10 ++++++++++ Utils/Encoding/XorEncoding.php | 10 ++++++++++ Utils/Formatter/HtmlFormatter.php | 12 +++++++++++- Utils/Parser/Markdown/Markdown.php | 4 ++-- 6 files changed, 53 insertions(+), 3 deletions(-) diff --git a/Utils/Encoding/Base64Url.php b/Utils/Encoding/Base64Url.php index eb13cf429..c7c5d0527 100644 --- a/Utils/Encoding/Base64Url.php +++ b/Utils/Encoding/Base64Url.php @@ -24,6 +24,16 @@ namespace phpOMS\Utils\Encoding; */ final class Base64Url { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Encode source text * diff --git a/Utils/Encoding/Caesar.php b/Utils/Encoding/Caesar.php index e7d13e6d7..ac8cba292 100755 --- a/Utils/Encoding/Caesar.php +++ b/Utils/Encoding/Caesar.php @@ -40,6 +40,16 @@ class Caesar */ public const LIMIT_UPPER = 127; + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Encode source text * diff --git a/Utils/Encoding/Gray.php b/Utils/Encoding/Gray.php index a73bcde62..1260650e3 100755 --- a/Utils/Encoding/Gray.php +++ b/Utils/Encoding/Gray.php @@ -24,6 +24,16 @@ namespace phpOMS\Utils\Encoding; */ final class Gray { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Encode source text * diff --git a/Utils/Encoding/XorEncoding.php b/Utils/Encoding/XorEncoding.php index d7505e216..1ef125d13 100755 --- a/Utils/Encoding/XorEncoding.php +++ b/Utils/Encoding/XorEncoding.php @@ -24,6 +24,16 @@ namespace phpOMS\Utils\Encoding; */ final class XorEncoding { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Decode text * diff --git a/Utils/Formatter/HtmlFormatter.php b/Utils/Formatter/HtmlFormatter.php index 3cb6bbf79..f8c396b1b 100644 --- a/Utils/Formatter/HtmlFormatter.php +++ b/Utils/Formatter/HtmlFormatter.php @@ -22,8 +22,18 @@ namespace phpOMS\Utils\Formatter; * @link https://jingga.app * @since 1.0.0 */ -class HtmlFormatter +final class HtmlFormatter { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Format html code * diff --git a/Utils/Parser/Markdown/Markdown.php b/Utils/Parser/Markdown/Markdown.php index a1c3b5fbe..0aeda4ff5 100755 --- a/Utils/Parser/Markdown/Markdown.php +++ b/Utils/Parser/Markdown/Markdown.php @@ -675,8 +675,8 @@ class Markdown */ protected function inlineCode(array $excerpt) : ?array { - if (($this->options['code']['inline'] ?? true) !== true - || ($this->options['code'] ?? true) !== true + if (!($this->options['code']['inline'] ?? true) + || !($this->options['code'] ?? true) ) { return null; }