From e04e3ddcece66ff0b8348a6af3c9ec14e36845a3 Mon Sep 17 00:00:00 2001 From: Charles Koko <55494612+charleskoko@users.noreply.github.com> Date: Fri, 25 Oct 2024 23:04:31 +0200 Subject: [PATCH] Use constant --- src/BlaspExpressionService.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/BlaspExpressionService.php b/src/BlaspExpressionService.php index 6d62102..e8a1f41 100644 --- a/src/BlaspExpressionService.php +++ b/src/BlaspExpressionService.php @@ -155,18 +155,18 @@ private function loadConfiguration(): void $this->validateChosenLanguage(); $this->cache[$this->chosenLanguage] = [ - self::KEY_PROFANITIES => config("blasp_{$this->chosenLanguage}.profanities"), - self::KEY_SEPARATORS => config("blasp.separators"), - self::KEY_SUBSTITUTIONS => config('blasp.substitutions'), - self::KEY_FALSE_POSITIVES => array_map('strtolower', config("blasp_{$this->chosenLanguage}.false_positives")), + self::KEY_PROFANITIES => config("blasp_{$this->chosenLanguage}." . self::KEY_PROFANITIES), + self::KEY_SEPARATORS => config("blasp." . self::KEY_SEPARATORS), + self::KEY_SUBSTITUTIONS => config('blasp.' . self::KEY_SUBSTITUTIONS), + self::KEY_FALSE_POSITIVES => array_map('strtolower', config("blasp_{$this->chosenLanguage}." . self::KEY_FALSE_POSITIVES)), ]; } - $this->profanities = $this->cache[$this->chosenLanguage]['profanities']; - $this->separators = $this->cache[$this->chosenLanguage]['separators']; - $this->substitutions = $this->cache[$this->chosenLanguage]['substitutions']; - $this->falsePositives = $this->cache[$this->chosenLanguage]['false_positives']; + $this->profanities = $this->cache[$this->chosenLanguage][self::KEY_PROFANITIES]; + $this->separators = $this->cache[$this->chosenLanguage][self::KEY_SEPARATORS]; + $this->substitutions = $this->cache[$this->chosenLanguage][self::KEY_SUBSTITUTIONS]; + $this->falsePositives = $this->cache[$this->chosenLanguage][self::KEY_FALSE_POSITIVES]; }