Ejemplo n.º 1
0
 /**
  * @param string $responseBindingType
  * @throws \InvalidArgumentException
  * @return JwtContext|$this
  */
 public function setResponseBindingType($responseBindingType)
 {
     if (!JwtBindingTypes::isValid($responseBindingType)) {
         throw new \InvalidArgumentException('Invalid binding type');
     }
     $this->responseBindingType = $responseBindingType;
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * @param string|null $binding
  * @throws \InvalidArgumentException
  */
 protected function checkBinding(&$binding)
 {
     $binding = $binding ? $binding : $this->getDefaultBinding();
     if (!JwtBindingTypes::isValid($binding)) {
         throw new \InvalidArgumentException('Invalid binding type ' . $binding);
     }
 }
 /**
  * @test
  */
 public function shouldIsValidReturnFalseForInvalidValue()
 {
     $this->assertFalse(JwtBindingTypes::isValid('foo'));
 }