Lcobucci\JWT\Claim\Factory::create PHP Метод

create() публичный Метод

Create a new claim
public create ( string $name, mixed $value ) : Lcobucci\JWT\Claim
$name string
$value mixed
Результат Lcobucci\JWT\Claim
    public function create(string $name, $value) : Claim
    {
        if (!empty($this->callbacks[$name])) {
            return call_user_func($this->callbacks[$name], $name, $value);
        }
        return $this->createBasic($name, $value);
    }

Usage Example

Пример #1
0
 /**
  * Configures a claim item
  *
  * @param string $name
  * @param mixed $value
  *
  * @return Builder
  *
  * @throws BadMethodCallException When data has been already signed
  */
 public function set($name, $value)
 {
     if ($this->signature) {
         throw new BadMethodCallException('You must unsign before make changes');
     }
     $this->claims[(string) $name] = $this->claimFactory->create($name, $value);
     return $this;
 }
All Usage Examples Of Lcobucci\JWT\Claim\Factory::create