addParameter() public method

public addParameter ( ParameterInterface $parameter )
$parameter ParameterInterface
示例#1
0
 public function testAddClaim()
 {
     $parameter = new Custom('foo', 'bar');
     $this->parameter->addParameter($parameter);
     $expectedValue = [self::$value[0], 'foo'];
     $this->assertSame($expectedValue, $this->parameter->getValue());
     $this->parameter->addParameter($parameter);
     $this->assertSame($expectedValue, $this->parameter->getValue(), 'Add parameter duplicates claims');
 }
示例#2
0
文件: Header.php 项目: emarref/jwt
 /**
  * @param HeaderParameter\ParameterInterface $parameter
  * @param boolean                            $critical
  */
 public function setParameter(HeaderParameter\ParameterInterface $parameter, $critical = false)
 {
     $this->propertyList->setProperty($parameter);
     if ($critical) {
         /** @var HeaderParameter\Critical $criticalParameter */
         $criticalParameter = $this->findParameterByName(HeaderParameter\Critical::NAME);
         if (!$criticalParameter) {
             $criticalParameter = new HeaderParameter\Critical();
         }
         $criticalParameter->addParameter($parameter);
         $this->propertyList->setProperty($criticalParameter);
     }
 }