diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index d29f0afde4..45909a92cd 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -411,7 +411,7 @@ abstract class PhabricatorApplication * To check if an application is installed //and// available to a particular * viewer, user @{method:isClassInstalledForViewer}. * - * @param string $class Application class name. + * @param class-string $class Application class name. * @return bool True if the class is installed. * @task meta */ @@ -427,7 +427,7 @@ abstract class PhabricatorApplication * To check if an application is installed at all, use * @{method:isClassInstalled}. * - * @param string $class Application class name. + * @param class-string $class Application class name. * @param PhabricatorUser $viewer Viewing user. * @return bool True if the class is installed for the viewer. * @task meta @@ -477,7 +477,7 @@ abstract class PhabricatorApplication * To check if an application is installed at all, use * @{method:isClassInstalled}. * - * @param string $class Application class name. + * @param class-string $class Application class name. * @param PhabricatorUser|null $viewer Viewing user. * @return bool True if the class is installed or if the installed class is * available to the viewer when a viewer is given. diff --git a/src/applications/calendar/worker/PhabricatorCalendarImportReloadWorker.php b/src/applications/calendar/worker/PhabricatorCalendarImportReloadWorker.php index 8f27a814ab..ab389bdbac 100644 --- a/src/applications/calendar/worker/PhabricatorCalendarImportReloadWorker.php +++ b/src/applications/calendar/worker/PhabricatorCalendarImportReloadWorker.php @@ -31,6 +31,9 @@ final class PhabricatorCalendarImportReloadWorker extends PhabricatorWorker { $import_engine->importEventsFromSource($author, $import, false); } + /** + * @return PhabricatorCalendarImportQuery + */ private function loadImport() { $viewer = PhabricatorUser::getOmnipotentUser(); diff --git a/src/applications/conduit/method/ConduitAPIMethod.php b/src/applications/conduit/method/ConduitAPIMethod.php index 096c63fc9e..e63fab5319 100644 --- a/src/applications/conduit/method/ConduitAPIMethod.php +++ b/src/applications/conduit/method/ConduitAPIMethod.php @@ -230,14 +230,30 @@ abstract class ConduitAPIMethod ->loadClass($method_name); } + /** + * Whether to require a session key for calling the API method. + * + * @return bool Defaults to true + */ public function shouldRequireAuthentication() { return true; } + /** + * Whether to allow public access. Related to the `policy.allow-public` + * global setting and policies set for the corresponding application. + * + * @return bool Defaults to false + */ public function shouldAllowPublic() { return false; } + /** + * Whether not to guard writes against CSRF. See @{class:AphrontWriteGuard}. + * + * @return bool Defaults to false + */ public function shouldAllowUnguardedWrites() { return false; } @@ -316,6 +332,7 @@ abstract class ConduitAPIMethod /** + * @return AphrontCursorPagerView * @task pager */ protected function newPager(ConduitAPIRequest $request) { diff --git a/src/applications/herald/field/HeraldField.php b/src/applications/herald/field/HeraldField.php index 0dd8686f96..d822f15eed 100644 --- a/src/applications/herald/field/HeraldField.php +++ b/src/applications/herald/field/HeraldField.php @@ -39,6 +39,11 @@ abstract class HeraldField extends Phobject { return null; } + /** + * @return array Conditions available in the dropdown after the object + * dropdown as one of the CONDITION_* constants defined in the + * HeraldAdapter class, rendered as e.g. "contains" or "is any of" + */ public function getHeraldFieldConditions() { $standard_type = $this->getHeraldFieldStandardType(); switch ($standard_type) { @@ -157,6 +162,9 @@ abstract class HeraldField extends Phobject { $standard_type)); } + /** + * @return bool + */ abstract public function supportsObject($object); public function getFieldsForObject($object) { diff --git a/src/applications/herald/value/HeraldEmptyFieldValue.php b/src/applications/herald/value/HeraldEmptyFieldValue.php index ac81cb7d23..a7ac5ab85f 100644 --- a/src/applications/herald/value/HeraldEmptyFieldValue.php +++ b/src/applications/herald/value/HeraldEmptyFieldValue.php @@ -1,5 +1,10 @@ Map of constants of application + * @param class-string $application Class name of an + * application. + * @return array Map of constants of + * application. */ public static function getAllTypesForApplication( string $application) { diff --git a/src/applications/phrequent/storage/PhrequentTimeBlock.php b/src/applications/phrequent/storage/PhrequentTimeBlock.php index 68ca563223..869b6d34fb 100644 --- a/src/applications/phrequent/storage/PhrequentTimeBlock.php +++ b/src/applications/phrequent/storage/PhrequentTimeBlock.php @@ -19,6 +19,9 @@ final class PhrequentTimeBlock extends Phobject { return $slices->getDuration($now); } + /** + * @return array + */ public function getObjectTimeRanges() { $ranges = array(); diff --git a/src/applications/policy/storage/PhabricatorPolicy.php b/src/applications/policy/storage/PhabricatorPolicy.php index e9f1c09fa1..c9c89a9176 100644 --- a/src/applications/policy/storage/PhabricatorPolicy.php +++ b/src/applications/policy/storage/PhabricatorPolicy.php @@ -348,7 +348,7 @@ final class PhabricatorPolicy * policy. This is used to bulk load data (like project memberships) in order * to apply policy filters efficiently. * - * @param string $rule_class Policy rule classname. + * @param class-string $rule_class Policy rule classname. * @return list List of values used in this policy. */ public function getCustomRuleValues($rule_class) { diff --git a/src/applications/project/controller/PhabricatorProjectBoardController.php b/src/applications/project/controller/PhabricatorProjectBoardController.php index 5427d1b93f..7afd5ba05c 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardController.php @@ -5,6 +5,9 @@ abstract class PhabricatorProjectBoardController private $viewState; + /** + * @return PhabricatorWorkboardViewState + */ final protected function getViewState() { if ($this->viewState === null) { $this->viewState = $this->newViewState(); @@ -22,6 +25,9 @@ abstract class PhabricatorProjectBoardController ->readFromRequest($request); } + /** + * @return AphrontDialogView + */ final protected function newWorkboardDialog() { $dialog = $this->newDialog(); diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php index 5693f77511..ad40e7520d 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php @@ -7,6 +7,9 @@ final class PhabricatorProjectBoardViewController return true; } + /** + * @return AphrontResponse|PhabricatorStandardPageView + */ public function handleRequest(AphrontRequest $request) { $viewer = $request->getUser(); @@ -400,6 +403,9 @@ final class PhabricatorProjectBoardViewController return $page; } + /** + * @return PHUIListItemView + */ private function buildSortMenu( PhabricatorUser $viewer, PhabricatorProject $project, @@ -473,6 +479,9 @@ final class PhabricatorProjectBoardViewController return $sort_button; } + /** + * @return PHUIListItemView + */ private function buildFilterMenu( PhabricatorUser $viewer, PhabricatorProject $project, diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index 7f7e45139e..79d0ac628a 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -1036,7 +1036,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { } /** - * @return int + * @return int|float Number of results to display (float if set to infinity) */ public function getPageSize(PhabricatorSavedQuery $saved) { $bucket = $this->getResultBucket($saved); diff --git a/src/applications/search/engineextension/PhabricatorSearchEngineExtension.php b/src/applications/search/engineextension/PhabricatorSearchEngineExtension.php index 17ed59f35f..be44db38e0 100644 --- a/src/applications/search/engineextension/PhabricatorSearchEngineExtension.php +++ b/src/applications/search/engineextension/PhabricatorSearchEngineExtension.php @@ -72,6 +72,17 @@ abstract class PhabricatorSearchEngineExtension extends Phobject { return array(); } + /** + * Add additional parameters to the $query based on elements in the $map + * @param $object A subclass of PhabricatorLiskDAO - a storage object, e.g. + * ManiphestTask or PhabricatorDashboardPortal + * @param $query A corresponding subclass of + * PhabricatorCursorPagedPolicyAwareQuery, e.g. ManiphestTaskQuery or + * PhabricatorDashboardPortalQuery + * @param PhabricatorSavedQuery $saved + * @param array $map + * @return void + */ public function applyConstraintsToQuery( $object, $query, diff --git a/src/applications/search/ferret/PhabricatorFerretEngine.php b/src/applications/search/ferret/PhabricatorFerretEngine.php index 3e4f04d866..7291d9c9ba 100644 --- a/src/applications/search/ferret/PhabricatorFerretEngine.php +++ b/src/applications/search/ferret/PhabricatorFerretEngine.php @@ -15,8 +15,8 @@ abstract class PhabricatorFerretEngine extends Phobject { */ abstract public function getScopeName(); /** - * @return string New instance of the corresponding - * PhabricatorApplicationSearchEngine subclass + * @return PhabricatorApplicationSearchEngine New instance of the + * corresponding PhabricatorApplicationSearchEngine subclass */ abstract public function newSearchEngine(); diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php index 5520647bcd..1aee12a53a 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngine.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php @@ -102,6 +102,13 @@ abstract class PhabricatorEditEngine return $keys; } + /** + * Split the Full Key into its Edit Engine Key and its Form Key + * + * @param string $full_key 'Edit Engine Key/Form Key' string, e.g. + * 'macro.image/default' or 'maniphest.task/5' + * @return array Edit Engine Key and Form Key + */ public static function splitFullKey($full_key) { return explode('/', $full_key, 2); } diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index ed407f6fff..9aaf46c2d9 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -103,7 +103,8 @@ abstract class PhabricatorApplicationTransactionEditor * * Uninstalling the application will disable the editor. * - * @return string Editor's application class name. + * @return class-string Editor's application + * class name. */ abstract public function getEditorApplicationClass(); diff --git a/src/infrastructure/daemon/workers/PhabricatorWorker.php b/src/infrastructure/daemon/workers/PhabricatorWorker.php index e187623e13..955dac094b 100644 --- a/src/infrastructure/daemon/workers/PhabricatorWorker.php +++ b/src/infrastructure/daemon/workers/PhabricatorWorker.php @@ -89,6 +89,9 @@ abstract class PhabricatorWorker extends Phobject { return $this; } + /** + * @return PhabricatorWorkerTask + */ public function getCurrentWorkerTask() { return $this->currentWorkerTask; } @@ -101,6 +104,13 @@ abstract class PhabricatorWorker extends Phobject { return $task->getID(); } + /** + * Perform some preparations and set up context, then call the final + * functionality (e.g. publishFeedStory() or importEvents() or whatever + * work the PhabricatorWorker subclass is supposed to do). + * + * @return void + */ abstract protected function doWork(); final public function __construct($data) { @@ -120,6 +130,11 @@ abstract class PhabricatorWorker extends Phobject { return idx($data, $key, $default); } + /** + * Public wrapper function which calls the doWork() function + * + * @return void + */ final public function executeTask() { $this->doWork(); }