Esempio n. 1
0
 public static function create($c)
 {
     if (!CompressMethod::isValid($c)) {
         throw new \Exception("Compression method is invalid", 1);
     }
     $method = "Compress" . CompressMethod::$enums[$c];
     return new $method();
 }
 public static function create($c)
 {
     $c = ucfirst(strtolower($c));
     if (!CompressMethod::isValid($c)) {
         throw new Exception("Compression method ({$c}) is not defined yet", 1);
     }
     $method = __NAMESPACE__ . "\\" . "Compress" . $c;
     return new $method();
 }