Skip to content

Commit

Permalink
Use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskoko committed Oct 25, 2024
1 parent 5e2a5f6 commit e04e3dd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/BlaspExpressionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];

}

Expand Down

0 comments on commit e04e3dd

Please sign in to comment.