isValid() public static method

public static isValid ( string $c ) : boolean
$c string
return boolean
Beispiel #1
0
 /**
  * @param string $c
  * @return CompressBzip2|CompressGzip|CompressNone
  */
 public static function create($c)
 {
     $c = ucfirst(strtolower($c));
     if (!CompressMethod::isValid($c)) {
         throw new Exception("Compression method ({$c}) is not defined yet");
     }
     $method = __NAMESPACE__ . "\\" . "Compress" . $c;
     return new $method();
 }