コード例 #1
0
ファイル: Request.php プロジェクト: minond/http
 /**
  * method setter
  * @param string $method
  * @throws InvalidArgumentException
  */
 public function setMethod($method)
 {
     $method = strtoupper($method);
     if (!Verb::valid($method)) {
         throw new InvalidArgumentException(sprintf('Invalid method type: %s, expects: [%s]', $method, implode(', ', Verb::options())));
     }
     $this->method = $method;
 }
コード例 #2
0
ファイル: VerbTest.php プロジェクト: minond/http
 public function testValidatingInvalidOptionsReturnsFalse()
 {
     $this->assertFalse(Verb::valid('invalid'));
 }