Psecio\Jwt\Jwt::__call PHP Метод

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

Magic method for setting claims by name Ex. "issuedAt()" calls Claims\IssuedAt
public __call ( string $name, array $args ) : Jwt
$name string Function name
$args array Arguments to pass
Результат Jwt instance
    public function __call($name, $args)
    {
        // see if it matches one of our claim types
        $className = "\\Psecio\\Jwt\\Claim\\" . ucwords($name);
        if (class_exists($className)) {
            $type = isset($args[1]) ? $args[1] : null;
            $claim = new $className($args[0]);
            $this->addClaim($claim);
            return $this;
        } else {
            throw new \InvalidArgumentException('Invalid claim type "' . $name . '"');
        }
    }