Predis\Profile\Factory::get PHP Méthode

get() public static méthode

Returns the specified server profile.
public static get ( string $version ) : Predis\Profile\ProfileInterface
$version string Profile version or alias.
Résultat Predis\Profile\ProfileInterface
    public static function get($version)
    {
        if (!isset(self::$profiles[$version])) {
            throw new ClientException("Unknown server profile: '{$version}'.");
        }
        $profile = self::$profiles[$version];
        return new $profile();
    }

Usage Example

Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function filter(OptionsInterface $options, $value)
 {
     if (is_string($value)) {
         $value = Factory::get($value);
         $this->setProcessors($options, $value);
     } elseif (!$value instanceof ProfileInterface) {
         throw new InvalidArgumentException('Invalid value for the profile option.');
     }
     return $value;
 }
All Usage Examples Of Predis\Profile\Factory::get