Skip to content

Commit

Permalink
Constant map in leet decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Stadly committed Jan 22, 2019
1 parent 36eb006 commit b61519f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/WordFormatter/LeetDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

final class LeetDecoder extends ChainableFormatter
{
/**
* @var array<string, string[]>
*/
private $encodeMap = [
private const ENCODE_MAP = [
'A' => ['4', '@', ''],
'B' => ['8', 'ß'],
'C' => ['(', '¢', '<', '[', '©'],
Expand Down Expand Up @@ -42,7 +39,7 @@ final class LeetDecoder extends ChainableFormatter

public function __construct()
{
foreach ($this->encodeMap as $char => $encodedChars) {
foreach (self::ENCODE_MAP as $char => $encodedChars) {
foreach ($encodedChars as $encodedChar) {
$this->decodeMap[$encodedChar][] = $char;
}
Expand Down

0 comments on commit b61519f

Please sign in to comment.