diff --git a/composer.json b/composer.json index 5cb734c..7f38e29 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "php": ">=5.3.0", + "php": "8.*", "illuminate/support": ">=4.0.0" }, "require-dev": { @@ -25,5 +25,10 @@ "JCrowe\\BadWordFilter\\": "src/" } }, - "minimum-stability": "stable" -} \ No newline at end of file + "minimum-stability": "stable", + "config": { + "allow-plugins": { + "kylekatarnls/update-helper": true + } + } +} diff --git a/src/JCrowe/BadWordFilter/BadWordFilter.php b/src/JCrowe/BadWordFilter/BadWordFilter.php index 724f472..b472e84 100644 --- a/src/JCrowe/BadWordFilter/BadWordFilter.php +++ b/src/JCrowe/BadWordFilter/BadWordFilter.php @@ -247,7 +247,7 @@ private function findBadWordsInArray(array $input = [], $previousKey = false) * * @return mixed */ - private function cleanArray(array $array = [], $replaceWith) + private function cleanArray(array $array, $replaceWith) { $dirtyKeys = $this->findBadWordsInArray($array); @@ -515,14 +515,8 @@ private function getBadWordsFromDB() */ private function flattenArray($array) { - $objTmp = (object)['aFlat' => []]; - - $callBack = function(&$v, $k, &$t) { - $t->aFlat[] = $v; - }; - - array_walk_recursive($array, $callBack, $objTmp); - + $objTmp = (object)['aFlat' => []]; + array_walk_recursive($array, function($v) use (&$objTmp){$objTmp->aFlat[] = $v;}); return $objTmp->aFlat; } @@ -548,4 +542,4 @@ private function hasAlternateSourceFile(array $options) return !empty($options['source_file']) && $options['source_file'] !== $this->defaults['source_file']; } -} +} \ No newline at end of file