mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Various linter fixes
Summary: Apply various linter fixes. Test Plan: Unit tests + eyeballing. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: hach-que, Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12390
This commit is contained in:
parent
f05a7ed7b5
commit
c896aeb62e
38 changed files with 123 additions and 142 deletions
|
@ -28,44 +28,44 @@ final class AphrontRequest {
|
||||||
private $applicationConfiguration;
|
private $applicationConfiguration;
|
||||||
private $uriData;
|
private $uriData;
|
||||||
|
|
||||||
final public function __construct($host, $path) {
|
public function __construct($host, $path) {
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setURIMap(array $uri_data) {
|
public function setURIMap(array $uri_data) {
|
||||||
$this->uriData = $uri_data;
|
$this->uriData = $uri_data;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getURIMap() {
|
public function getURIMap() {
|
||||||
return $this->uriData;
|
return $this->uriData;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getURIData($key, $default = null) {
|
public function getURIData($key, $default = null) {
|
||||||
return idx($this->uriData, $key, $default);
|
return idx($this->uriData, $key, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setApplicationConfiguration(
|
public function setApplicationConfiguration(
|
||||||
$application_configuration) {
|
$application_configuration) {
|
||||||
$this->applicationConfiguration = $application_configuration;
|
$this->applicationConfiguration = $application_configuration;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getApplicationConfiguration() {
|
public function getApplicationConfiguration() {
|
||||||
return $this->applicationConfiguration;
|
return $this->applicationConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setPath($path) {
|
public function setPath($path) {
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getPath() {
|
public function getPath() {
|
||||||
return $this->path;
|
return $this->path;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getHost() {
|
public function getHost() {
|
||||||
// The "Host" header may include a port number, or may be a malicious
|
// The "Host" header may include a port number, or may be a malicious
|
||||||
// header in the form "realdomain.com:ignored@evil.com". Invoke the full
|
// header in the form "realdomain.com:ignored@evil.com". Invoke the full
|
||||||
// parser to extract the real domain correctly. See here for coverage of
|
// parser to extract the real domain correctly. See here for coverage of
|
||||||
|
@ -83,7 +83,7 @@ final class AphrontRequest {
|
||||||
/**
|
/**
|
||||||
* @task data
|
* @task data
|
||||||
*/
|
*/
|
||||||
final public function setRequestData(array $request_data) {
|
public function setRequestData(array $request_data) {
|
||||||
$this->requestData = $request_data;
|
$this->requestData = $request_data;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ final class AphrontRequest {
|
||||||
/**
|
/**
|
||||||
* @task data
|
* @task data
|
||||||
*/
|
*/
|
||||||
final public function getRequestData() {
|
public function getRequestData() {
|
||||||
return $this->requestData;
|
return $this->requestData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ final class AphrontRequest {
|
||||||
/**
|
/**
|
||||||
* @task data
|
* @task data
|
||||||
*/
|
*/
|
||||||
final public function getInt($name, $default = null) {
|
public function getInt($name, $default = null) {
|
||||||
if (isset($this->requestData[$name])) {
|
if (isset($this->requestData[$name])) {
|
||||||
return (int)$this->requestData[$name];
|
return (int)$this->requestData[$name];
|
||||||
} else {
|
} else {
|
||||||
|
@ -112,7 +112,7 @@ final class AphrontRequest {
|
||||||
/**
|
/**
|
||||||
* @task data
|
* @task data
|
||||||
*/
|
*/
|
||||||
final public function getBool($name, $default = null) {
|
public function getBool($name, $default = null) {
|
||||||
if (isset($this->requestData[$name])) {
|
if (isset($this->requestData[$name])) {
|
||||||
if ($this->requestData[$name] === 'true') {
|
if ($this->requestData[$name] === 'true') {
|
||||||
return true;
|
return true;
|
||||||
|
@ -130,7 +130,7 @@ final class AphrontRequest {
|
||||||
/**
|
/**
|
||||||
* @task data
|
* @task data
|
||||||
*/
|
*/
|
||||||
final public function getStr($name, $default = null) {
|
public function getStr($name, $default = null) {
|
||||||
if (isset($this->requestData[$name])) {
|
if (isset($this->requestData[$name])) {
|
||||||
$str = (string)$this->requestData[$name];
|
$str = (string)$this->requestData[$name];
|
||||||
// Normalize newline craziness.
|
// Normalize newline craziness.
|
||||||
|
@ -148,7 +148,7 @@ final class AphrontRequest {
|
||||||
/**
|
/**
|
||||||
* @task data
|
* @task data
|
||||||
*/
|
*/
|
||||||
final public function getArr($name, $default = array()) {
|
public function getArr($name, $default = array()) {
|
||||||
if (isset($this->requestData[$name]) &&
|
if (isset($this->requestData[$name]) &&
|
||||||
is_array($this->requestData[$name])) {
|
is_array($this->requestData[$name])) {
|
||||||
return $this->requestData[$name];
|
return $this->requestData[$name];
|
||||||
|
@ -161,7 +161,7 @@ final class AphrontRequest {
|
||||||
/**
|
/**
|
||||||
* @task data
|
* @task data
|
||||||
*/
|
*/
|
||||||
final public function getStrList($name, $default = array()) {
|
public function getStrList($name, $default = array()) {
|
||||||
if (!isset($this->requestData[$name])) {
|
if (!isset($this->requestData[$name])) {
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
@ -174,36 +174,36 @@ final class AphrontRequest {
|
||||||
/**
|
/**
|
||||||
* @task data
|
* @task data
|
||||||
*/
|
*/
|
||||||
final public function getExists($name) {
|
public function getExists($name) {
|
||||||
return array_key_exists($name, $this->requestData);
|
return array_key_exists($name, $this->requestData);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getFileExists($name) {
|
public function getFileExists($name) {
|
||||||
return isset($_FILES[$name]) &&
|
return isset($_FILES[$name]) &&
|
||||||
(idx($_FILES[$name], 'error') !== UPLOAD_ERR_NO_FILE);
|
(idx($_FILES[$name], 'error') !== UPLOAD_ERR_NO_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isHTTPGet() {
|
public function isHTTPGet() {
|
||||||
return ($_SERVER['REQUEST_METHOD'] == 'GET');
|
return ($_SERVER['REQUEST_METHOD'] == 'GET');
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isHTTPPost() {
|
public function isHTTPPost() {
|
||||||
return ($_SERVER['REQUEST_METHOD'] == 'POST');
|
return ($_SERVER['REQUEST_METHOD'] == 'POST');
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isAjax() {
|
public function isAjax() {
|
||||||
return $this->getExists(self::TYPE_AJAX) && !$this->isQuicksand();
|
return $this->getExists(self::TYPE_AJAX) && !$this->isQuicksand();
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isWorkflow() {
|
public function isWorkflow() {
|
||||||
return $this->getExists(self::TYPE_WORKFLOW) && !$this->isQuicksand();
|
return $this->getExists(self::TYPE_WORKFLOW) && !$this->isQuicksand();
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isQuicksand() {
|
public function isQuicksand() {
|
||||||
return $this->getExists(self::TYPE_QUICKSAND);
|
return $this->getExists(self::TYPE_QUICKSAND);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isConduit() {
|
public function isConduit() {
|
||||||
return $this->getExists(self::TYPE_CONDUIT);
|
return $this->getExists(self::TYPE_CONDUIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ final class AphrontRequest {
|
||||||
return 'X-Phabricator-Csrf';
|
return 'X-Phabricator-Csrf';
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function validateCSRF() {
|
public function validateCSRF() {
|
||||||
$token_name = self::getCSRFTokenName();
|
$token_name = self::getCSRFTokenName();
|
||||||
$token = $this->getStr($token_name);
|
$token = $this->getStr($token_name);
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ final class AphrontRequest {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isFormPost() {
|
public function isFormPost() {
|
||||||
$post = $this->getExists(self::TYPE_FORM) &&
|
$post = $this->getExists(self::TYPE_FORM) &&
|
||||||
!$this->getExists(self::TYPE_HISEC) &&
|
!$this->getExists(self::TYPE_HISEC) &&
|
||||||
$this->isHTTPPost();
|
$this->isHTTPPost();
|
||||||
|
@ -293,7 +293,7 @@ final class AphrontRequest {
|
||||||
return $this->validateCSRF();
|
return $this->validateCSRF();
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isFormOrHisecPost() {
|
public function isFormOrHisecPost() {
|
||||||
$post = $this->getExists(self::TYPE_FORM) &&
|
$post = $this->getExists(self::TYPE_FORM) &&
|
||||||
$this->isHTTPPost();
|
$this->isHTTPPost();
|
||||||
|
|
||||||
|
@ -305,12 +305,12 @@ final class AphrontRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
final public function setCookiePrefix($prefix) {
|
public function setCookiePrefix($prefix) {
|
||||||
$this->cookiePrefix = $prefix;
|
$this->cookiePrefix = $prefix;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final private function getPrefixedCookieName($name) {
|
private function getPrefixedCookieName($name) {
|
||||||
if (strlen($this->cookiePrefix)) {
|
if (strlen($this->cookiePrefix)) {
|
||||||
return $this->cookiePrefix.'_'.$name;
|
return $this->cookiePrefix.'_'.$name;
|
||||||
} else {
|
} else {
|
||||||
|
@ -318,7 +318,7 @@ final class AphrontRequest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getCookie($name, $default = null) {
|
public function getCookie($name, $default = null) {
|
||||||
$name = $this->getPrefixedCookieName($name);
|
$name = $this->getPrefixedCookieName($name);
|
||||||
$value = idx($_COOKIE, $name, $default);
|
$value = idx($_COOKIE, $name, $default);
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ final class AphrontRequest {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function clearCookie($name) {
|
public function clearCookie($name) {
|
||||||
$this->setCookieWithExpiration($name, '', time() - (60 * 60 * 24 * 30));
|
$this->setCookieWithExpiration($name, '', time() - (60 * 60 * 24 * 30));
|
||||||
unset($_COOKIE[$name]);
|
unset($_COOKIE[$name]);
|
||||||
}
|
}
|
||||||
|
@ -390,7 +390,7 @@ final class AphrontRequest {
|
||||||
*
|
*
|
||||||
* @task cookie
|
* @task cookie
|
||||||
*/
|
*/
|
||||||
final public function canSetCookies() {
|
public function canSetCookies() {
|
||||||
return (bool)$this->getCookieDomainURI();
|
return (bool)$this->getCookieDomainURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ final class AphrontRequest {
|
||||||
* @return this
|
* @return this
|
||||||
* @task cookie
|
* @task cookie
|
||||||
*/
|
*/
|
||||||
final public function setCookie($name, $value) {
|
public function setCookie($name, $value) {
|
||||||
$far_future = time() + (60 * 60 * 24 * 365 * 5);
|
$far_future = time() + (60 * 60 * 24 * 365 * 5);
|
||||||
return $this->setCookieWithExpiration($name, $value, $far_future);
|
return $this->setCookieWithExpiration($name, $value, $far_future);
|
||||||
}
|
}
|
||||||
|
@ -421,7 +421,7 @@ final class AphrontRequest {
|
||||||
* @return this
|
* @return this
|
||||||
* @task cookie
|
* @task cookie
|
||||||
*/
|
*/
|
||||||
final public function setTemporaryCookie($name, $value) {
|
public function setTemporaryCookie($name, $value) {
|
||||||
return $this->setCookieWithExpiration($name, $value, 0);
|
return $this->setCookieWithExpiration($name, $value, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@ final class AphrontRequest {
|
||||||
* @return this
|
* @return this
|
||||||
* @task cookie
|
* @task cookie
|
||||||
*/
|
*/
|
||||||
final private function setCookieWithExpiration(
|
private function setCookieWithExpiration(
|
||||||
$name,
|
$name,
|
||||||
$value,
|
$value,
|
||||||
$expire) {
|
$expire) {
|
||||||
|
@ -485,31 +485,31 @@ final class AphrontRequest {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setUser($user) {
|
public function setUser($user) {
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getUser() {
|
public function getUser() {
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getViewer() {
|
public function getViewer() {
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getRequestURI() {
|
public function getRequestURI() {
|
||||||
$get = $_GET;
|
$get = $_GET;
|
||||||
unset($get['__path__']);
|
unset($get['__path__']);
|
||||||
$path = phutil_escape_uri($this->getPath());
|
$path = phutil_escape_uri($this->getPath());
|
||||||
return id(new PhutilURI($path))->setQueryParams($get);
|
return id(new PhutilURI($path))->setQueryParams($get);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isDialogFormPost() {
|
public function isDialogFormPost() {
|
||||||
return $this->isFormPost() && $this->getStr('__dialog__');
|
return $this->isFormPost() && $this->getStr('__dialog__');
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getRemoteAddr() {
|
public function getRemoteAddr() {
|
||||||
return $_SERVER['REMOTE_ADDR'];
|
return $_SERVER['REMOTE_ADDR'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,11 @@ final class AphrontURIMapper {
|
||||||
|
|
||||||
private $map;
|
private $map;
|
||||||
|
|
||||||
final public function __construct(array $map) {
|
public function __construct(array $map) {
|
||||||
$this->map = $map;
|
$this->map = $map;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function mapPath($path) {
|
public function mapPath($path) {
|
||||||
$map = $this->map;
|
$map = $this->map;
|
||||||
foreach ($map as $rule => $value) {
|
foreach ($map as $rule => $value) {
|
||||||
list($controller, $data) = $this->tryRule($rule, $value, $path);
|
list($controller, $data) = $this->tryRule($rule, $value, $path);
|
||||||
|
@ -25,7 +25,7 @@ final class AphrontURIMapper {
|
||||||
return array(null, null);
|
return array(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
final private function tryRule($rule, $value, $path) {
|
private function tryRule($rule, $value, $path) {
|
||||||
$match = null;
|
$match = null;
|
||||||
$pattern = '#^'.$rule.(is_array($value) ? '' : '$').'#';
|
$pattern = '#^'.$rule.(is_array($value) ? '' : '$').'#';
|
||||||
if (!preg_match($pattern, $path, $match)) {
|
if (!preg_match($pattern, $path, $match)) {
|
||||||
|
|
|
@ -18,7 +18,7 @@ final class CelerityResourceGraph extends AbstractDirectedGraph {
|
||||||
return $edges;
|
return $edges;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setResourceGraph(array $graph) {
|
public function setResourceGraph(array $graph) {
|
||||||
$this->resourceGraph = $graph;
|
$this->resourceGraph = $graph;
|
||||||
$this->graphSet = true;
|
$this->graphSet = true;
|
||||||
return $this;
|
return $this;
|
||||||
|
|
|
@ -13,12 +13,12 @@ final class DiffusionPathChange {
|
||||||
private $targetCommitIdentifier;
|
private $targetCommitIdentifier;
|
||||||
private $awayPaths = array();
|
private $awayPaths = array();
|
||||||
|
|
||||||
final public function setPath($path) {
|
public function setPath($path) {
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getPath() {
|
public function getPath() {
|
||||||
return $this->path;
|
return $this->path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,58 +58,58 @@ final class DiffusionPathChange {
|
||||||
return $this->awayPaths;
|
return $this->awayPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setCommitIdentifier($commit) {
|
public function setCommitIdentifier($commit) {
|
||||||
$this->commitIdentifier = $commit;
|
$this->commitIdentifier = $commit;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getCommitIdentifier() {
|
public function getCommitIdentifier() {
|
||||||
return $this->commitIdentifier;
|
return $this->commitIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setTargetCommitIdentifier($target_commit_identifier) {
|
public function setTargetCommitIdentifier($target_commit_identifier) {
|
||||||
$this->targetCommitIdentifier = $target_commit_identifier;
|
$this->targetCommitIdentifier = $target_commit_identifier;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getTargetCommitIdentifier() {
|
public function getTargetCommitIdentifier() {
|
||||||
return $this->targetCommitIdentifier;
|
return $this->targetCommitIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setCommit($commit) {
|
public function setCommit($commit) {
|
||||||
$this->commit = $commit;
|
$this->commit = $commit;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getCommit() {
|
public function getCommit() {
|
||||||
return $this->commit;
|
return $this->commit;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setCommitData($commit_data) {
|
public function setCommitData($commit_data) {
|
||||||
$this->commitData = $commit_data;
|
$this->commitData = $commit_data;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getCommitData() {
|
public function getCommitData() {
|
||||||
return $this->commitData;
|
return $this->commitData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
final public function getEpoch() {
|
public function getEpoch() {
|
||||||
if ($this->getCommit()) {
|
if ($this->getCommit()) {
|
||||||
return $this->getCommit()->getEpoch();
|
return $this->getCommit()->getEpoch();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getAuthorName() {
|
public function getAuthorName() {
|
||||||
if ($this->getCommitData()) {
|
if ($this->getCommitData()) {
|
||||||
return $this->getCommitData()->getAuthorName();
|
return $this->getCommitData()->getAuthorName();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getSummary() {
|
public function getSummary() {
|
||||||
if (!$this->getCommitData()) {
|
if (!$this->getCommitData()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ final class DiffusionPathChange {
|
||||||
return substr($first, 0, 80);
|
return substr($first, 0, 80);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public static function convertToArcanistChanges(array $changes) {
|
public static function convertToArcanistChanges(array $changes) {
|
||||||
assert_instances_of($changes, __CLASS__);
|
assert_instances_of($changes, __CLASS__);
|
||||||
$direct = array();
|
$direct = array();
|
||||||
$result = array();
|
$result = array();
|
||||||
|
@ -142,7 +142,7 @@ final class DiffusionPathChange {
|
||||||
return array_select_keys($result, $direct);
|
return array_select_keys($result, $direct);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public static function convertToDifferentialChangesets(
|
public static function convertToDifferentialChangesets(
|
||||||
PhabricatorUser $user,
|
PhabricatorUser $user,
|
||||||
array $changes) {
|
array $changes) {
|
||||||
assert_instances_of($changes, __CLASS__);
|
assert_instances_of($changes, __CLASS__);
|
||||||
|
|
|
@ -30,7 +30,7 @@ final class DiffusionRenameHistoryQuery {
|
||||||
return $this->oldCommit;
|
return $this->oldCommit;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function loadOldFilename() {
|
public function loadOldFilename() {
|
||||||
$drequest = $this->request;
|
$drequest = $this->request;
|
||||||
$repository_id = $drequest->getRepository()->getID();
|
$repository_id = $drequest->getRepository()->getID();
|
||||||
$conn_r = id(new PhabricatorRepository())->establishConnection('r');
|
$conn_r = id(new PhabricatorRepository())->establishConnection('r');
|
||||||
|
|
|
@ -14,11 +14,11 @@ final class DiffusionPathChangeQuery {
|
||||||
return $this->limit;
|
return $this->limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
final private function __construct() {
|
private function __construct() {
|
||||||
// <private>
|
// <private>
|
||||||
}
|
}
|
||||||
|
|
||||||
final public static function newFromDiffusionRequest(
|
public static function newFromDiffusionRequest(
|
||||||
DiffusionRequest $request) {
|
DiffusionRequest $request) {
|
||||||
$query = new DiffusionPathChangeQuery();
|
$query = new DiffusionPathChangeQuery();
|
||||||
$query->request = $request;
|
$query->request = $request;
|
||||||
|
@ -26,11 +26,11 @@ final class DiffusionPathChangeQuery {
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
final protected function getRequest() {
|
protected function getRequest() {
|
||||||
return $this->request;
|
return $this->request;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function loadChanges() {
|
public function loadChanges() {
|
||||||
return $this->executeQuery();
|
return $this->executeQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
|
||||||
return $this->loadPHIDsFromAddresses($addresses);
|
return $this->loadPHIDsFromAddresses($addresses);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function loadCCPHIDs() {
|
public function loadCCPHIDs() {
|
||||||
return $this->loadPHIDsFromAddresses($this->getCCAddresses());
|
return $this->loadPHIDsFromAddresses($this->getCCAddresses());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,6 @@ abstract class PhabricatorPeopleController extends PhabricatorController {
|
||||||
return $this->buildSideNavView(true)->getMenu();
|
return $this->buildSideNavView(true)->getMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildApplicationCrumbs() {
|
|
||||||
return parent::buildApplicationCrumbs();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildIconNavView(PhabricatorUser $user) {
|
public function buildIconNavView(PhabricatorUser $user) {
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
$picture = $user->getProfileImageURI();
|
$picture = $user->getProfileImageURI();
|
||||||
|
|
|
@ -293,13 +293,6 @@ final class ReleephRequest extends ReleephDAO
|
||||||
throw new Exception('`status` is now deprecated!');
|
throw new Exception('`status` is now deprecated!');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -( Make magic Lisk methods private )------------------------------------ */
|
|
||||||
|
|
||||||
private function setUserIntents(array $ar) {
|
|
||||||
return parent::setUserIntents($ar);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
|
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -146,10 +146,6 @@ final class ReleephRequestTransaction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getActionStrength() {
|
|
||||||
return parent::getActionStrength();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getActionName() {
|
public function getActionName() {
|
||||||
switch ($this->getTransactionType()) {
|
switch ($this->getTransactionType()) {
|
||||||
case self::TYPE_REQUEST:
|
case self::TYPE_REQUEST:
|
||||||
|
|
|
@ -10,7 +10,7 @@ final class PhabricatorTokenCountQuery
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function execute() {
|
public function execute() {
|
||||||
$table = new PhabricatorTokenCount();
|
$table = new PhabricatorTokenCount();
|
||||||
$conn_r = $table->establishConnection('r');
|
$conn_r = $table->establishConnection('r');
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,6 @@ final class PhabricatorEvent extends PhutilEvent {
|
||||||
private $aphrontRequest;
|
private $aphrontRequest;
|
||||||
private $conduitRequest;
|
private $conduitRequest;
|
||||||
|
|
||||||
public function __construct($type, array $data = array()) {
|
|
||||||
parent::__construct($type, $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setUser(PhabricatorUser $user) {
|
public function setUser(PhabricatorUser $user) {
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
return $this;
|
return $this;
|
||||||
|
|
|
@ -40,7 +40,7 @@ final class DefaultDatabaseConfigurationProvider
|
||||||
return $this->namespace.'_'.$this->getDao()->getApplicationName();
|
return $this->namespace.'_'.$this->getDao()->getApplicationName();
|
||||||
}
|
}
|
||||||
|
|
||||||
final protected function getDao() {
|
protected function getDao() {
|
||||||
return $this->dao;
|
return $this->dao;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ final class LiskDAOSet {
|
||||||
* The main purpose of this method is to break cyclic dependency.
|
* The main purpose of this method is to break cyclic dependency.
|
||||||
* It removes all objects from this set and all subsets created by it.
|
* It removes all objects from this set and all subsets created by it.
|
||||||
*/
|
*/
|
||||||
final public function clearSet() {
|
public function clearSet() {
|
||||||
$this->daos = array();
|
$this->daos = array();
|
||||||
$this->relatives = array();
|
$this->relatives = array();
|
||||||
foreach ($this->subsets as $set) {
|
foreach ($this->subsets as $set) {
|
||||||
|
|
|
@ -174,7 +174,7 @@ final class AphrontDialogView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function render() {
|
public function render() {
|
||||||
require_celerity_resource('aphront-dialog-view-css');
|
require_celerity_resource('aphront-dialog-view-css');
|
||||||
|
|
||||||
$buttons = array();
|
$buttons = array();
|
||||||
|
|
|
@ -46,7 +46,7 @@ final class AphrontJavelinView extends AphrontView {
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setName($template_name) {
|
public function setName($template_name) {
|
||||||
$this->name = $template_name;
|
$this->name = $template_name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ final class AphrontJavelinView extends AphrontView {
|
||||||
return $this->parameters;
|
return $this->parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setParameters($template_parameters) {
|
public function setParameters($template_parameters) {
|
||||||
$this->parameters = $template_parameters;
|
$this->parameters = $template_parameters;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ final class AphrontJavelinView extends AphrontView {
|
||||||
return $this->celerityResource;
|
return $this->celerityResource;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setCelerityResource($celerity_resource) {
|
public function setCelerityResource($celerity_resource) {
|
||||||
$this->celerityResource = $celerity_resource;
|
$this->celerityResource = $celerity_resource;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,64 +13,64 @@ final class AphrontCursorPagerView extends AphrontView {
|
||||||
|
|
||||||
private $uri;
|
private $uri;
|
||||||
|
|
||||||
final public function setPageSize($page_size) {
|
public function setPageSize($page_size) {
|
||||||
$this->pageSize = max(1, $page_size);
|
$this->pageSize = max(1, $page_size);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getPageSize() {
|
public function getPageSize() {
|
||||||
return $this->pageSize;
|
return $this->pageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setURI(PhutilURI $uri) {
|
public function setURI(PhutilURI $uri) {
|
||||||
$this->uri = $uri;
|
$this->uri = $uri;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function readFromRequest(AphrontRequest $request) {
|
public function readFromRequest(AphrontRequest $request) {
|
||||||
$this->uri = $request->getRequestURI();
|
$this->uri = $request->getRequestURI();
|
||||||
$this->afterID = $request->getStr('after');
|
$this->afterID = $request->getStr('after');
|
||||||
$this->beforeID = $request->getStr('before');
|
$this->beforeID = $request->getStr('before');
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setAfterID($after_id) {
|
public function setAfterID($after_id) {
|
||||||
$this->afterID = $after_id;
|
$this->afterID = $after_id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getAfterID() {
|
public function getAfterID() {
|
||||||
return $this->afterID;
|
return $this->afterID;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setBeforeID($before_id) {
|
public function setBeforeID($before_id) {
|
||||||
$this->beforeID = $before_id;
|
$this->beforeID = $before_id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getBeforeID() {
|
public function getBeforeID() {
|
||||||
return $this->beforeID;
|
return $this->beforeID;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setNextPageID($next_page_id) {
|
public function setNextPageID($next_page_id) {
|
||||||
$this->nextPageID = $next_page_id;
|
$this->nextPageID = $next_page_id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getNextPageID() {
|
public function getNextPageID() {
|
||||||
return $this->nextPageID;
|
return $this->nextPageID;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setPrevPageID($prev_page_id) {
|
public function setPrevPageID($prev_page_id) {
|
||||||
$this->prevPageID = $prev_page_id;
|
$this->prevPageID = $prev_page_id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getPrevPageID() {
|
public function getPrevPageID() {
|
||||||
return $this->prevPageID;
|
return $this->prevPageID;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function sliceResults(array $results) {
|
public function sliceResults(array $results) {
|
||||||
if (count($results) > $this->getPageSize()) {
|
if (count($results) > $this->getPageSize()) {
|
||||||
$offset = ($this->beforeID ? count($results) - $this->getPageSize() : 0);
|
$offset = ($this->beforeID ? count($results) - $this->getPageSize() : 0);
|
||||||
$results = array_slice($results, $offset, $this->getPageSize(), true);
|
$results = array_slice($results, $offset, $this->getPageSize(), true);
|
||||||
|
@ -79,7 +79,7 @@ final class AphrontCursorPagerView extends AphrontView {
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getHasMoreResults() {
|
public function getHasMoreResults() {
|
||||||
return $this->moreResults;
|
return $this->moreResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,52 +13,52 @@ final class AphrontPagerView extends AphrontView {
|
||||||
private $surroundingPages = 2;
|
private $surroundingPages = 2;
|
||||||
private $enableKeyboardShortcuts;
|
private $enableKeyboardShortcuts;
|
||||||
|
|
||||||
final public function setPageSize($page_size) {
|
public function setPageSize($page_size) {
|
||||||
$this->pageSize = max(1, $page_size);
|
$this->pageSize = max(1, $page_size);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setOffset($offset) {
|
public function setOffset($offset) {
|
||||||
$this->offset = max(0, $offset);
|
$this->offset = max(0, $offset);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getOffset() {
|
public function getOffset() {
|
||||||
return $this->offset;
|
return $this->offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getPageSize() {
|
public function getPageSize() {
|
||||||
return $this->pageSize;
|
return $this->pageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setCount($count) {
|
public function setCount($count) {
|
||||||
$this->count = $count;
|
$this->count = $count;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setHasMorePages($has_more) {
|
public function setHasMorePages($has_more) {
|
||||||
$this->hasMorePages = $has_more;
|
$this->hasMorePages = $has_more;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setURI(PhutilURI $uri, $paging_parameter) {
|
public function setURI(PhutilURI $uri, $paging_parameter) {
|
||||||
$this->uri = $uri;
|
$this->uri = $uri;
|
||||||
$this->pagingParameter = $paging_parameter;
|
$this->pagingParameter = $paging_parameter;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function readFromRequest(AphrontRequest $request) {
|
public function readFromRequest(AphrontRequest $request) {
|
||||||
$this->uri = $request->getRequestURI();
|
$this->uri = $request->getRequestURI();
|
||||||
$this->pagingParameter = 'offset';
|
$this->pagingParameter = 'offset';
|
||||||
$this->offset = $request->getInt($this->pagingParameter);
|
$this->offset = $request->getInt($this->pagingParameter);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function willShowPagingControls() {
|
public function willShowPagingControls() {
|
||||||
return $this->hasMorePages;
|
return $this->hasMorePages;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function setSurroundingPages($pages) {
|
public function setSurroundingPages($pages) {
|
||||||
$this->surroundingPages = max(0, $pages);
|
$this->surroundingPages = max(0, $pages);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ final class PHUIInfoView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function render() {
|
public function render() {
|
||||||
require_celerity_resource('phui-info-view-css');
|
require_celerity_resource('phui-info-view-css');
|
||||||
|
|
||||||
$errors = $this->errors;
|
$errors = $this->errors;
|
||||||
|
|
Loading…
Reference in a new issue