protected function addItem(string $key, array $values): void
    {
        if (!array_key_exists('source', $values) || !array_key_exists('target', $values)) {
            throw new \InvalidArgumentException('Invalid translation array: ' . var_export($values, true));
        }

        $this->translationBuffer[$key] = new MemoryTranslationValue($key, $values['source'], $values['target']);
    }