diff --git a/src/applications/auth/controller/PhabricatorAuthController.php b/src/applications/auth/controller/PhabricatorAuthController.php index 7d0156dc18..fd33d7948c 100644 --- a/src/applications/auth/controller/PhabricatorAuthController.php +++ b/src/applications/auth/controller/PhabricatorAuthController.php @@ -2,6 +2,10 @@ abstract class PhabricatorAuthController extends PhabricatorController { + /** + * @return PhabricatorStandardPageView PhabricatorStandardPageView with a + * @{class:PHUIInfoView} child displaying error messages. + */ protected function renderErrorPage($title, array $messages) { $view = new PHUIInfoView(); $view->setTitle($title); @@ -14,9 +18,11 @@ abstract class PhabricatorAuthController extends PhabricatorController { } /** - * Returns true if this install is newly setup (i.e., there are no user + * Returns true if this install is newly set up (i.e., there are no user * accounts yet). In this case, we enter a special mode to permit creation * of the first account form the web UI. + * + * @return bool */ protected function isFirstTimeSetup() { // If there are any auth providers, this isn't first time setup, even if @@ -94,6 +100,11 @@ abstract class PhabricatorAuthController extends PhabricatorController { $request->clearCookie(PhabricatorCookies::COOKIE_INVITE); } + /** + * @return AphrontRedirectResponse Redirect to /auth/validate/, including + * an "expect" parameter with the expected username, to be validated in + * @{class:PhabricatorAuthValidateController} + */ private function buildLoginValidateResponse(PhabricatorUser $user) { $validate_uri = new PhutilURI($this->getApplicationURI('validate/')); $validate_uri->replaceQueryParam('expect', $user->getUsername()); @@ -109,6 +120,12 @@ abstract class PhabricatorAuthController extends PhabricatorController { )); } + /** + * @return array Returns or + * in case of + * an error, or + * in case of success. + */ protected function loadAccountForRegistrationOrLinking($account_key) { $request = $this->getRequest(); $viewer = $request->getUser(); @@ -214,6 +231,9 @@ abstract class PhabricatorAuthController extends PhabricatorController { return array($account, $provider, null); } + /** + * @return PhabricatorAuthInvite|null Invitation, or null if none exists + */ protected function loadInvite() { $invite_cookie = PhabricatorCookies::COOKIE_INVITE; $invite_code = $this->getRequest()->getCookie($invite_cookie); @@ -235,6 +255,9 @@ abstract class PhabricatorAuthController extends PhabricatorController { } } + /** + * @return PHUIBoxView|null + */ protected function renderInviteHeader(PhabricatorAuthInvite $invite) { $viewer = $this->getViewer(); @@ -275,7 +298,9 @@ abstract class PhabricatorAuthController extends PhabricatorController { ->appendChild($invite_list); } - + /** + * @return PhutilSafeHTML|null + */ final protected function newCustomStartMessage() { $viewer = $this->getViewer(); diff --git a/src/applications/auth/engine/PhabricatorAuthInviteEngine.php b/src/applications/auth/engine/PhabricatorAuthInviteEngine.php index 2881de12ff..d37c68d765 100644 --- a/src/applications/auth/engine/PhabricatorAuthInviteEngine.php +++ b/src/applications/auth/engine/PhabricatorAuthInviteEngine.php @@ -32,6 +32,9 @@ final class PhabricatorAuthInviteEngine extends Phobject { return $this->userHasConfirmedVerify; } + /** + * @return PhabricatorAuthInvite + */ public function processInviteCode($code) { $viewer = $this->getViewer(); diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php index 1ad43b8bef..8023a1854f 100644 --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -423,10 +423,16 @@ abstract class PhabricatorController extends AphrontController { ->setSubmitURI($submit_uri); } + /** + * @return AphrontRedirectResponse + */ public function newRedirect() { return id(new AphrontRedirectResponse()); } + /** + * @return PhabricatorStandardPageView + */ public function newPage() { $page = id(new PhabricatorStandardPageView()) ->setRequest($this->getRequest()) @@ -449,6 +455,9 @@ abstract class PhabricatorController extends AphrontController { return $page; } + /** + * @return PHUIApplicationMenuView + */ public function newApplicationMenu() { return id(new PHUIApplicationMenuView()) ->setViewer($this->getViewer()); diff --git a/src/applications/conduit/data/ConduitConstantDescription.php b/src/applications/conduit/data/ConduitConstantDescription.php index c9b2d00f6b..8cfa1fd64f 100644 --- a/src/applications/conduit/data/ConduitConstantDescription.php +++ b/src/applications/conduit/data/ConduitConstantDescription.php @@ -6,6 +6,9 @@ final class ConduitConstantDescription extends Phobject { private $value; private $isDeprecated; + /** + * @param string $key Key of the constant + */ public function setKey($key) { $this->key = $key; return $this; @@ -15,6 +18,9 @@ final class ConduitConstantDescription extends Phobject { return $this->key; } + /** + * @param string $value Description of the constant + */ public function setValue($value) { $this->value = $value; return $this; @@ -24,6 +30,9 @@ final class ConduitConstantDescription extends Phobject { return $this->value; } + /** + * @param bool $is_deprecated Whether the constant is deprecated + */ public function setIsDeprecated($is_deprecated) { $this->isDeprecated = $is_deprecated; return $this; diff --git a/src/applications/conduit/method/ConduitAPIMethod.php b/src/applications/conduit/method/ConduitAPIMethod.php index 1d55947246..0e07d0a626 100644 --- a/src/applications/conduit/method/ConduitAPIMethod.php +++ b/src/applications/conduit/method/ConduitAPIMethod.php @@ -49,11 +49,17 @@ abstract class ConduitAPIMethod return array(); } + /** + * @return ConduitAPIDocumentationPage + */ final protected function newDocumentationPage(PhabricatorUser $viewer) { return id(new ConduitAPIDocumentationPage()) ->setIconIcon('fa-chevron-right'); } + /** + * @return ConduitAPIDocumentationPage + */ final protected function newDocumentationBoxPage( PhabricatorUser $viewer, $title, @@ -183,6 +189,8 @@ abstract class ConduitAPIMethod /** * Return a key which sorts methods by application name, then method status, * then method name. + * + * @return string For example 'almanac.0.namespace.edit' or 'user.2.enable' */ public function getSortOrder() { $name = $this->getAPIMethodName(); diff --git a/src/applications/config/option/PhabricatorConfigOption.php b/src/applications/config/option/PhabricatorConfigOption.php index d7a117e3ef..a39b44df77 100644 --- a/src/applications/config/option/PhabricatorConfigOption.php +++ b/src/applications/config/option/PhabricatorConfigOption.php @@ -85,6 +85,9 @@ final class PhabricatorConfigOption return $this; } + /** + * @return array Pairs of a config value and its description + */ public function getExamples() { return $this->examples; } @@ -103,6 +106,9 @@ final class PhabricatorConfigOption return $this; } + /** + * @return array Array of boolean options, defaults to True and False + */ public function getBoolOptions() { if ($this->boolOptions) { return $this->boolOptions; diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php index 824cfadf36..a3e030303b 100644 --- a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php +++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php @@ -116,6 +116,9 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject { return $this->panelPHID; } + /** + * @return PHUIObjectBoxView + */ public function renderPanel() { $panel = $this->getPanel(); @@ -240,6 +243,9 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject { $header); } + /** + * @return PHUIObjectBoxView + */ private function renderPanelDiv( $content, $header = null, diff --git a/src/applications/home/engine/PhabricatorHomeProfileMenuEngine.php b/src/applications/home/engine/PhabricatorHomeProfileMenuEngine.php index 8015853bca..a94ca76a76 100644 --- a/src/applications/home/engine/PhabricatorHomeProfileMenuEngine.php +++ b/src/applications/home/engine/PhabricatorHomeProfileMenuEngine.php @@ -29,6 +29,11 @@ final class PhabricatorHomeProfileMenuEngine ); } + /** + * Returns the menu items in the default home sidebar + * + * @return array + */ protected function getBuiltinProfileItems($object) { $viewer = $this->getViewer(); $items = array(); diff --git a/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php b/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php index 9a53e8fad7..83cabad4b6 100644 --- a/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php +++ b/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php @@ -33,6 +33,9 @@ final class PhabricatorHomeProfileMenuItem return $this->getDefaultName(); } + /** + * @return PHUIHomeView + */ public function newPageContent( PhabricatorProfileMenuItemConfiguration $config) { $viewer = $this->getViewer(); @@ -41,6 +44,9 @@ final class PhabricatorHomeProfileMenuItem ->setViewer($viewer); } + /** + * @return array + */ public function buildEditEngineFields( PhabricatorProfileMenuItemConfiguration $config) { return array( @@ -52,6 +58,9 @@ final class PhabricatorHomeProfileMenuItem ); } + /** + * @return array + */ protected function newMenuItemViewList( PhabricatorProfileMenuItemConfiguration $config) { $viewer = $this->getViewer(); diff --git a/src/applications/home/view/PHUIHomeView.php b/src/applications/home/view/PHUIHomeView.php index d7eb9f37bf..900eabe387 100644 --- a/src/applications/home/view/PHUIHomeView.php +++ b/src/applications/home/view/PHUIHomeView.php @@ -11,6 +11,13 @@ final class PHUIHomeView return array(); } + /** + * Construct the default homepage dashboard. + * + * @return PHUIBoxView Homepage dashboard content: a PHUIBoxView which wraps + * a @{class:AphrontMultiColumnView} which includes numerous + * @{class:PHUIObjectBoxView} boxes + */ protected function getTagContent() { require_celerity_resource('phabricator-dashboard-css'); $viewer = $this->getViewer(); @@ -77,6 +84,9 @@ final class PHUIHomeView return $view; } + /** + * @return PHUIObjectBoxView + */ private function buildRevisionPanel() { $viewer = $this->getViewer(); if (!$viewer->isLoggedIn()) { @@ -91,6 +101,9 @@ final class PHUIHomeView return $this->renderPanel($panel); } + /** + * @return PHUIObjectBoxView + */ private function buildTasksPanel() { $viewer = $this->getViewer(); @@ -111,6 +124,9 @@ final class PHUIHomeView return $this->renderPanel($panel); } + /** + * @return PHUIObjectBoxView + */ public function buildFeedPanel() { $panel = $this->newQueryPanel() ->setName(pht('Recent Activity')) @@ -121,6 +137,9 @@ final class PHUIHomeView return $this->renderPanel($panel); } + /** + * @return PHUIObjectBoxView + */ public function buildRepositoryPanel() { $panel = $this->newQueryPanel() ->setName(pht('Active Repositories')) @@ -131,6 +150,9 @@ final class PHUIHomeView return $this->renderPanel($panel); } + /** + * @return PhabricatorDashboardPanel + */ private function newQueryPanel() { $panel_type = id(new PhabricatorDashboardQueryPanelType()) ->getPanelTypeKey(); @@ -139,6 +161,9 @@ final class PHUIHomeView ->setPanelType($panel_type); } + /** + * @return PHUIObjectBoxView + */ private function renderPanel(PhabricatorDashboardPanel $panel) { $viewer = $this->getViewer(); diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index 6b8d7aff37..4cbeb68b94 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -774,6 +774,9 @@ final class PhabricatorApplicationSearchController return $menu; } + /** + * @return AphrontSideNavFilterView + */ private function buildNavigation() { $viewer = $this->getViewer(); $engine = $this->getSearchEngine(); @@ -787,6 +790,13 @@ final class PhabricatorApplicationSearchController return $nav; } + /** + * Render a content body (if available) to onboard new users. This may return + * what the corresponding PhabricatorApplicationSearchEngine returns, or null + * based on some additional checks performed in this function. + * + * @return mixed|PhutilSafeHTML|null + */ private function renderNewUserView( PhabricatorApplicationSearchEngine $engine, $force_nux) { @@ -830,6 +840,9 @@ final class PhabricatorApplicationSearchController return $nux_view; } + /** + * @return PHUIButtonView + */ private function newUseResultsDropdown( PhabricatorSavedQuery $query, array $dropdown_items) { @@ -889,6 +902,9 @@ final class PhabricatorApplicationSearchController return $message; } + /** + * @return PHUIInfoView + */ private function newOverheatedView(array $results) { $message = self::newOverheatedError((bool)$results); @@ -902,6 +918,9 @@ final class PhabricatorApplicationSearchController )); } + /** + * @return PhabricatorActionView + */ private function newBuiltinUseActions() { $actions = array(); $request = $this->getRequest(); diff --git a/src/applications/search/editor/PhabricatorProfileMenuEditEngine.php b/src/applications/search/editor/PhabricatorProfileMenuEditEngine.php index 445be7777f..5fe0e08685 100644 --- a/src/applications/search/editor/PhabricatorProfileMenuEditEngine.php +++ b/src/applications/search/editor/PhabricatorProfileMenuEditEngine.php @@ -20,6 +20,9 @@ final class PhabricatorProfileMenuEditEngine return $this; } + /** + * @return PhabricatorProfileMenuEngine + */ public function getMenuEngine() { return $this->menuEngine; } @@ -48,6 +51,9 @@ final class PhabricatorProfileMenuEditEngine return $this; } + /** + * @return PhabricatorProfileMenuItemConfiguration + */ public function getNewMenuItemConfiguration() { return $this->newMenuItemConfiguration; } diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index 0ba6360412..42837431f1 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -91,11 +91,21 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { return $this->viewer; } + /** + * Set rendering context (e.g. list or panel) + * + * @param $context string A CONTEXT_* constant + */ public function setContext($context) { $this->context = $context; return $this; } + /** + * Whether this is in the context of rendering a panel + * + * @return bool True if in panel context + */ public function isPanelContext() { return ($this->context == self::CONTEXT_PANEL); } diff --git a/src/applications/search/engine/PhabricatorProfileMenuEngine.php b/src/applications/search/engine/PhabricatorProfileMenuEngine.php index dbd95f2fe8..e4f0477b74 100644 --- a/src/applications/search/engine/PhabricatorProfileMenuEngine.php +++ b/src/applications/search/engine/PhabricatorProfileMenuEngine.php @@ -28,24 +28,39 @@ abstract class PhabricatorProfileMenuEngine extends Phobject { return $this->viewer; } + /** + * @param object $profile_object A PhabricatorApplication subclass + */ public function setProfileObject($profile_object) { $this->profileObject = $profile_object; return $this; } + /** + * @return object A PhabricatorApplication subclass + */ public function getProfileObject() { return $this->profileObject; } + /** + * @param $custom_phid A User PHID + */ public function setCustomPHID($custom_phid) { $this->customPHID = $custom_phid; return $this; } + /** + * @return string|null A User PHID, or null + */ public function getCustomPHID() { return $this->customPHID; } + /** + * @return string|null A User PHID, or null + */ private function getEditModeCustomPHID() { $mode = $this->getEditMode(); diff --git a/src/applications/search/field/PhabricatorSearchField.php b/src/applications/search/field/PhabricatorSearchField.php index 5c224ca6a8..175dc1d903 100644 --- a/src/applications/search/field/PhabricatorSearchField.php +++ b/src/applications/search/field/PhabricatorSearchField.php @@ -382,6 +382,9 @@ abstract class PhabricatorSearchField extends Phobject { return $this->enableForConduit; } + /** + * @return array + */ public function newConduitConstants() { return array(); } diff --git a/src/applications/search/menuitem/PhabricatorProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorProfileMenuItem.php index 067c98725b..d5fe3f42e5 100644 --- a/src/applications/search/menuitem/PhabricatorProfileMenuItem.php +++ b/src/applications/search/menuitem/PhabricatorProfileMenuItem.php @@ -66,6 +66,9 @@ abstract class PhabricatorProfileMenuItem extends Phobject { ->execute(); } + /** + * @return PhabricatorProfileMenuItemView + */ final protected function newItemView() { return new PhabricatorProfileMenuItemView(); } diff --git a/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php b/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php index 4307b19732..f78b7598cc 100644 --- a/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php +++ b/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php @@ -198,6 +198,9 @@ final class PhabricatorProfileMenuItemConfiguration return ($this->getVisibility() === self::VISIBILITY_DEFAULT); } + /** + * @return int|string + */ public function getItemIdentifier() { $id = $this->getID(); @@ -208,6 +211,9 @@ final class PhabricatorProfileMenuItemConfiguration return $this->getBuiltinKey(); } + /** + * @return string + */ public function getDefaultMenuItemKey() { if ($this->getBuiltinKey()) { return $this->getBuiltinKey(); diff --git a/src/infrastructure/env/PhabricatorConfigDatabaseSource.php b/src/infrastructure/env/PhabricatorConfigDatabaseSource.php index e4eab86b74..7e549bac4a 100644 --- a/src/infrastructure/env/PhabricatorConfigDatabaseSource.php +++ b/src/infrastructure/env/PhabricatorConfigDatabaseSource.php @@ -1,5 +1,8 @@