protected function getPreferenceOrFail(string $key)
    {
        if (!$this->registry->has($key)) {
            throw new UnregisteredPreferenceException(
                sprintf(
                    'There\'s no setting registered with key `%s`',
                    $key
                )
            );
        }

        return $this->registry->get($key);
    }