本文整理汇总了PHP中Checker::argIntPositiveOrNull方法的典型用法代码示例。如果您正苦于以下问题:PHP Checker::argIntPositiveOrNull方法的具体用法?PHP Checker::argIntPositiveOrNull怎么用?PHP Checker::argIntPositiveOrNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checker
的用法示例。
在下文中一共展示了Checker::argIntPositiveOrNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRevisions
/**
* Gets the metadata for all the file revisions (up to a limit) for a given path.
*
* See <a href="https://www.dropbox.com/developers/core/docs#revisions">/revisions</a>.
*
* @param string path
* The Dropbox path that you want file revision metadata for (UTF-8).
*
* @param int|null limit
* The maximum number of revisions to return.
*
* @return array|null
* A list of <a href="https://www.dropbox.com/developers/core/docs#metadata-details>metadata
* objects</a>, one for each file revision. The later revisions appear first in the list.
* If <code>null</code>, then there were too many revisions at that path.
*
* @throws Exception
*/
function getRevisions($path, $limit = null)
{
Path::checkArgNonRoot("path", $path);
Checker::argIntPositiveOrNull("limit", $limit);
$response = $this->doGet($this->apiHost, $this->appendFilePath("1/revisions", $path), array("rev_limit" => $limit));
if ($response->statusCode === 406) {
return null;
}
if ($response->statusCode !== 200) {
throw RequestUtil::unexpectedStatus($response);
}
return RequestUtil::parseResponseJson($response->body);
}