public function addWord(string $capitalCase, string $lowerCase = null)
    {
        if ($lowerCase == null) {
            $lowerCase = strtolower($capitalCase);
        }

        $index = strtolower($lowerCase);
        $record = [$capitalCase, $lowerCase];

        $this->words[$index] = $record;

        if ($index !== strtolower($capitalCase)) {
            $this->words[strtolower($capitalCase)] = $record;
        }
    }
public function addWord(string $capitalCase, string $lowerCase = null)
    {
        if ($lowerCase == null) {
            $lowerCase = strtolower($capitalCase);
        }

        $index = strtolower($lowerCase);
        $record = [$capitalCase, $lowerCase];

        $this->words[$index] = $record;

        if ($index !== strtolower($capitalCase)) {
            $this->words[strtolower($capitalCase)] = $record;
        }
    }
public function addWord ( string $ capitalCase , string $ lowerCase = null ) { if ( $ lowerCase == null ) { $ lowerCase = strtolower ( $ capitalCase ) ; } $ index = strtolower ( $ lowerCase ) ; $ record = [ $ capitalCase , $ lowerCase ] ; $ this -> words [ $ index ] = $ record ; if ( $ index !== strtolower ( $ capitalCase ) ) { $ this -> words [ strtolower ( $ capitalCase ) ] = $ record ; } }
Add a word to the singletons dictionary.

@param string $capitalCase The capital version of the word.
@param string|null $lowerCase The lowercase version, in case it is different from the capital case but all lower.
Add a word to the singletons dictionary .