code: protected function getKey(array $config)
      {
          if (!isset($config['key']) || !is_string($config['key'])) {
              throw new \DomainException(
                  'key must reference a string',
                  self::ERR_INVALID_KEY
              );
          }
          return $config['key'];
      }
docs: Extracts a Google API key for interacting with the YouTube API from
  configuration.
  
  @param array $config
  @return string
  @throws \DomainException if key setting is invalid