From 6fd89047549f76066fbc361ffc05a9d77cedac1d Mon Sep 17 00:00:00 2001 From: Caleb Mazalevskis Date: Mon, 14 Oct 2024 15:41:52 +0800 Subject: [PATCH] Stricter typing. --- Changelog.txt | 2 ++ src/Aggregator.php | 17 +++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index affd466..ed5fd69 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -11,6 +11,8 @@ Versioning guidelines for SemVer can be found at: https://semver.org/ - [2024.08.02; Maikuolan]: Fixed some typos. +- [2024.10.14]: Strictened typing for the aggregator. + === Version/Release 1.3.4 === PATCH RELEASE. diff --git a/src/Aggregator.php b/src/Aggregator.php index 5027050..99d769b 100644 --- a/src/Aggregator.php +++ b/src/Aggregator.php @@ -1,6 +1,6 @@ Output = $In; $this->stripInvalidCharactersAndSort($this->Output); @@ -173,14 +176,12 @@ private function constructTables() /** * Strips invalid characters from lines and sorts entries. * - * @param string|array + * @param string * @return void */ private function stripInvalidCharactersAndSort(&$In) { - if (!is_array($In)) { - $In = explode("\n", strtolower(trim(str_replace("\r", '', $In)))); - } + $In = explode("\n", strtolower(trim(str_replace("\r", '', $In)))); $InCount = count($In); if (isset($this->callbacks['newParse']) && is_callable($this->callbacks['newParse'])) { $this->callbacks['newParse']($InCount);