email) $user->load(); $this->basic($user->email); $this->owner = $user; } /** * @see Base */ protected function set_scope(string $method) { switch ($method) { case "create": $this->scope = sprintf("/users/%s/tokens", $this->owner->username); return true; } return false; } /** * Create a new token * * Valid parameters: * * 1. name * * This reflects the API v1 documentation. * * @param ...$args The parameter values * @return bool */ public function create(...$args) { $params = array( "name" => isset($args[0]) && is_string($args[0]) ? $args[0] : null ); $params = array_filter($params, function($val) { return $val != null; }); return parent::create($params); } } }