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 . '"');
}
}