Beispiel #1
0
 public function setMethod(array $server) : self
 {
     if (array_key_exists('REQUEST_METHOD', $server)) {
         $this->method = Http::getMethod($server['REQUEST_METHOD']);
     }
     return $this;
 }
Beispiel #2
0
 public function setMethods(array $methods) : self
 {
     foreach ($methods as $k => $v) {
         if (!Http::isMethod($v)) {
             throw new Exception("invalid Method : " . $v);
         }
         $methods[$k] = Http::getMethod($v);
     }
     $this->methods = $methods;
     return $this;
 }