Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/374068 )
Change subject: Improve some parameter docs ...................................................................... Improve some parameter docs Change-Id: I40aeba848e7969b219242631daced88d96939438 --- M CodeReviewHooks.php M api/ApiQueryCodeRevisions.php M backend/CodeComment.php M backend/CodePropChange.php M backend/CodeRepository.php M backend/CodeRevision.php M backend/CodeSignoff.php M backend/DiffHighlighter.php M backend/RepoStats.php M backend/Subversion.php M maintenance/showEmails.php M phpcs.xml M ui/CodeRepoListView.php M ui/CodeRevisionCommitter.php M ui/CodeRevisionListView.php M ui/CodeRevisionView.php M ui/CodeView.php M ui/SpecialCode.php M ui/SpecialRepoAdmin.php M ui/WordCloud.php 20 files changed, 98 insertions(+), 105 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeReview refs/changes/68/374068/1 diff --git a/CodeReviewHooks.php b/CodeReviewHooks.php index 767acbd..0d7ab0e 100644 --- a/CodeReviewHooks.php +++ b/CodeReviewHooks.php @@ -28,7 +28,7 @@ * * Only MySQL(/MariaDB) and SQLite are supported at the moment. * - * @param $updater DatabaseUpdater + * @param DatabaseUpdater $updater * @return bool */ public static function onLoadExtensionSchemaUpdates( $updater ) { @@ -117,8 +117,8 @@ * current repository when we're on Special:Code, or to be more specific, * a subpage of a repository on Special:Code. * - * @param $values array - * @param $out OutputPage + * @param array &$values + * @param OutputPage $out * @return bool */ public static function onMakeGlobalVariablesScript( &$values, $out ) { @@ -136,7 +136,7 @@ /** * For integration with the Renameuser extension. * - * @param $renameUserSQL RenameuserSQL + * @param RenameuserSQL $renameUserSQL * @return bool */ public static function onRenameUserSQL( $renameUserSQL ) { @@ -156,7 +156,7 @@ /** * For integration with the UserMerge extension. * - * @param array $updateFields + * @param array &$updateFields * @return bool */ public static function onUserMergeAccountFields( &$updateFields ) { diff --git a/api/ApiQueryCodeRevisions.php b/api/ApiQueryCodeRevisions.php index e9d3703..2b7af03 100644 --- a/api/ApiQueryCodeRevisions.php +++ b/api/ApiQueryCodeRevisions.php @@ -107,9 +107,9 @@ } /** - * @param $row - * @param $repo CodeRepository - * @param $result ApiResult + * @param stdClass $row + * @param CodeRepository $repo + * @param ApiResult $result * @return array */ private function formatRow( $row, $repo, $result ) { @@ -160,7 +160,7 @@ } /** - * @param $rev CodeRevision + * @param CodeRevision $rev * @return array */ protected function addReferenced( $rev ) { diff --git a/backend/CodeComment.php b/backend/CodeComment.php index abf0e10..aa3f442 100644 --- a/backend/CodeComment.php +++ b/backend/CodeComment.php @@ -20,7 +20,7 @@ /** * @param CodeRevision $rev - * @param $row + * @param stdClass $row * @return CodeComment */ static function newFromRow( $rev, $row ) { diff --git a/backend/CodePropChange.php b/backend/CodePropChange.php index 3657b6c..ec89da8 100644 --- a/backend/CodePropChange.php +++ b/backend/CodePropChange.php @@ -18,7 +18,7 @@ /** * @param CodeRevision $rev - * @param $row + * @param stdClass $row * @return CodePropChange */ static function newFromRow( $rev, $row ) { @@ -27,7 +27,7 @@ /** * @param CodeRevision $rev - * @param $data + * @param array $data * @return CodePropChange */ static function newFromData( $rev, $data ) { diff --git a/backend/CodeRepository.php b/backend/CodeRepository.php index 21e6fb4..02525e8 100644 --- a/backend/CodeRepository.php +++ b/backend/CodeRepository.php @@ -93,7 +93,7 @@ } /** - * @param $row + * @param stdClass $row * @return CodeRepository */ static function newFromRow( $row ) { @@ -158,7 +158,7 @@ /** * Return a bug URL or false * - * @param $bugId int|string + * @param int|string $bugId * @return string|bool */ public function getBugPath( $bugId ) { @@ -227,7 +227,7 @@ /** * Get a list of all tags in use in the repository - * @param $recache Bool whether to get clean data + * @param bool $recache whether to get clean data * @return array */ public function getTagList( $recache = false ) { @@ -431,7 +431,7 @@ /** * Set diff cache (for import operations) - * @param $codeRev CodeRevision + * @param CodeRevision $codeRev */ public function setDiffCache( CodeRevision $codeRev ) { global $wgMemc; diff --git a/backend/CodeRevision.php b/backend/CodeRevision.php index ea77c5e..daafaeb 100644 --- a/backend/CodeRevision.php +++ b/backend/CodeRevision.php @@ -19,7 +19,7 @@ /** * @static * @param CodeRepository $repo - * @param $data + * @param array $data * @return CodeRevision */ public static function newFromSvn( CodeRepository $repo, $data ) { @@ -129,7 +129,7 @@ * @static * @throws Exception * @param CodeRepository $repo - * @param $row + * @param stdClass $row * @return CodeRevision */ public static function newFromRow( CodeRepository $repo, $row ) { @@ -159,7 +159,7 @@ /** * Like getId(), but returns the result as a string, including prefix, * i.e. "r123" instead of 123. - * @param $id + * @param int|null $id * @return string */ public function getIdString( $id = null ) { @@ -177,7 +177,7 @@ * confusing (e.g. in emails, page titles etc.). If only one repository is * defined then this returns the same as getIdString() as there is no ambiguity. * - * @param $id int + * @param int $id * @return string */ public function getIdStringUnique( $id = null ) { @@ -216,7 +216,7 @@ } /** - * @return + * @return string */ public function getTimestamp() { return $this->timestamp; @@ -276,7 +276,7 @@ } /** - * @param $key string + * @param string $key * @return string */ private static function makeStateMessageKey( $key ) { @@ -312,8 +312,8 @@ /** * @throws Exception - * @param $status String, value in CodeRevision::getPossibleStates - * @param $user User + * @param string $status value in CodeRevision::getPossibleStates + * @param User $user * @return bool */ public function setStatus( $status, $user ) { @@ -663,7 +663,7 @@ } /** - * @param $text + * @param string $text * @param null $parent * @return CodeComment */ @@ -674,8 +674,8 @@ } /** - * @param $text string - * @param $parent null + * @param string $text + * @param null $parent * @return int */ public function saveComment( $text, $parent = null ) { @@ -700,8 +700,8 @@ } /** - * @param $subject String - * @param $body String + * @param string $subject + * @param string $body * @return void */ public function emailNotifyUsersOfChanges( $subject, $body ) { @@ -755,8 +755,8 @@ } /** - * @param $text string - * @param $parent null| + * @param string $text + * @param null $parent * @return array */ protected function commentData( $text, $parent = null ) { @@ -778,8 +778,8 @@ /** * @throws Exception - * @param $parent - * @param $ts + * @param null $parent + * @param string $ts * @return string */ protected function threadedSortKey( $parent, $ts ) { @@ -997,7 +997,7 @@ * * This function will silently refuse to add a reference from a revision to itself or from * revisions in its past (i.e. with lower revision IDs) - * @param $revs array of revision IDs + * @param array $revs array of revision IDs */ public function addReferencesFrom( $revs ) { $data = []; @@ -1025,7 +1025,7 @@ /** * Same as addReferencesFrom(), but adds references from this revision to * the specified revisions. - * @param $revs array of revision IDs + * @param array $revs array of revision IDs */ public function addReferencesTo( $revs ) { $data = []; @@ -1044,7 +1044,7 @@ /** * Remove references from the specified revisions to this revision. In the UI, this will * no longer show the specified revisions as follow-ups to this one. - * @param $revs array of revision IDs + * @param array $revs array of revision IDs */ public function removeReferencesFrom( $revs ) { $dbw = wfGetDB( DB_MASTER ); @@ -1059,7 +1059,7 @@ /** * Remove references to the specified revisions from this revision. * - * @param $revs array of revision IDs + * @param array $revs array of revision IDs */ public function removeReferencesTo( $revs ) { $dbw = wfGetDB( DB_MASTER ); @@ -1073,7 +1073,7 @@ /** * Get all sign-offs for this revision - * @param $from int DB_SLAVE or DB_MASTER + * @param int $from DB_SLAVE or DB_MASTER * @return array of CodeSignoff objects */ public function getSignoffs( $from = DB_SLAVE ) { @@ -1098,8 +1098,8 @@ /** * Add signoffs for this revision - * @param $user User object for the user who did the sign-off - * @param $flags array of flags (strings, see getPossibleFlags()). Each flag is added as + * @param User $user User object for the user who did the sign-off + * @param array $flags array of flags (strings, see getPossibleFlags()). Each flag is added as * a separate sign-off */ public function addSignoff( $user, $flags ) { @@ -1123,8 +1123,8 @@ * Strike a set of sign-offs by a given user. Any sign-offs in $ids not * by $user are silently ignored, as well as nonexistent IDs and * already-struck sign-offs. - * @param $user User object - * @param $ids array of sign-off IDs to strike + * @param User $user User object + * @param array $ids array of sign-off IDs to strike */ public function strikeSignoffs( $user, $ids ) { foreach ( $ids as $id ) { @@ -1160,9 +1160,9 @@ } /** - * @param $addTags array - * @param $removeTags array - * @param $user User + * @param array $addTags + * @param array $removeTags + * @param User $user */ public function changeTags( $addTags, $removeTags, $user = null ) { // Get the current tags and see what changes @@ -1211,7 +1211,7 @@ } /** - * @param $tags Array + * @param array $tags * @return array */ protected function normalizeTags( $tags ) { @@ -1223,7 +1223,7 @@ } /** - * @param $tags Array + * @param array $tags * @return array */ protected function tagData( $tags ) { @@ -1241,7 +1241,7 @@ } /** - * @param $tag String + * @param string $tag * @return bool */ public function normalizeTag( $tag ) { @@ -1255,8 +1255,8 @@ } /** - * @param $tag String - * @return bool + * @param string $tag + * @return bool */ public function isValidTag( $tag ) { return ( $this->normalizeTag( $tag ) !== false ); @@ -1325,7 +1325,7 @@ } /** - * @param $path + * @param string $path * @return array */ protected function getPathConds( $path ) { @@ -1373,7 +1373,7 @@ /** * Get the canonical URL of a revision. Constructs a Title for this revision * along the lines of [[Special:Code/RepoName/12345#c678]] and calls getCanonicalURL(). - * @param $commentId string|int + * @param string|int $commentId * @return string */ public function getCanonicalUrl( $commentId = 0 ) { diff --git a/backend/CodeSignoff.php b/backend/CodeSignoff.php index 97730d9..79c1eb3 100644 --- a/backend/CodeSignoff.php +++ b/backend/CodeSignoff.php @@ -24,12 +24,12 @@ * in the database. * * For more detailed explanations of what each of the parameters mean, see public members. - * @param $rev CodeRevision object - * @param $user int User ID - * @param $userText string User name - * @param $flag string Flag - * @param $timestamp string TS_MW timestamp - * @param $timestampStruck string Raw (unformatted!) timestamp from the cs_timestamp_struck + * @param CodeRevision $rev CodeRevision object + * @param int $user User ID + * @param string $userText User name + * @param string $flag Flag + * @param string $timestamp TS_MW timestamp + * @param string $timestampStruck Raw (unformatted!) timestamp from the cs_timestamp_struck * DB field */ public function __construct( $rev, $user, $userText, $flag, $timestamp, $timestampStruck ) { @@ -92,8 +92,8 @@ /** * Create a CodeSignoff object from a revision and a database row object - * @param $rev CodeRevision object the signoff belongs to - * @param $row object Database row with cs_* fields from code_signoffs + * @param CodeRevision $rev CodeRevision object the signoff belongs to + * @param object $row Database row with cs_* fields from code_signoffs * @return CodeSignoff */ public static function newFromRow( $rev, $row ) { @@ -102,8 +102,8 @@ /** * Create a CodeSignoff object from a revision and a database row in array format - * @param $rev CodeRevision object the signoff belongs to - * @param $data array Database row with cs_* fields from code_signoffs + * @param CodeRevision $rev CodeRevision object the signoff belongs to + * @param array $data Database row with cs_* fields from code_signoffs * @return CodeSignoff */ public static function newFromData( $rev, $data ) { @@ -114,8 +114,8 @@ /** * Create a CodeSignoff object from a revision object and an ID previously obtained from getID() - * @param $rev CodeRevision object - * @param $id string ID generated by getID() + * @param CodeRevision $rev CodeRevision object + * @param string $id ID generated by getID() * @return CodeSignoff */ public static function newFromID( $rev, $id ) { diff --git a/backend/DiffHighlighter.php b/backend/DiffHighlighter.php index f7d5f3d..f33699c 100644 --- a/backend/DiffHighlighter.php +++ b/backend/DiffHighlighter.php @@ -17,7 +17,7 @@ * Main entry point. Given a diff text, highlight it * and wrap it in a div * - * @param $text string Text to highlight + * @param string $text Text to highlight * @return string */ function render( $text ) { @@ -30,7 +30,7 @@ * Given a bunch of text, split it into individual * lines, color them, then put it back into one big * string - * @param $text string Text to split and highlight + * @param string $text Text to split and highlight * @return string */ function splitLines( $text ) { @@ -88,8 +88,8 @@ } /** - * @param $content string - * @param $class string + * @param string $content + * @param string $class * @return string */ function formatLine( $content, $class = null ) { @@ -180,7 +180,7 @@ /** * Turn a diff line into a properly formatted string suitable * for output - * @param $line string Line from a diff + * @param string $line Line from a diff * @return string */ function colorLine( $line ) { @@ -193,7 +193,7 @@ /** * Take a line of a diff and apply the appropriate stylings - * @param $line string Line to check + * @param string $line Line to check * @return array */ function tagForLine( $line ) { @@ -234,7 +234,7 @@ * * NOTE: visibility is 'public' since the function covered by tests. * - * @param $chunkHeader string a one line chunk as described above + * @param string $chunkHeader a one line chunk as described above * @throws Exception * @return array with the four values above as an array */ diff --git a/backend/RepoStats.php b/backend/RepoStats.php index baa23f5..fea940c 100644 --- a/backend/RepoStats.php +++ b/backend/RepoStats.php @@ -40,7 +40,7 @@ } /** - * @param $repo CodeRepository + * @param CodeRepository $repo */ public function __construct( CodeRepository $repo ) { $this->repo = $repo; @@ -96,7 +96,7 @@ } /** - * @param $status string + * @param string $status * * @return array */ @@ -120,7 +120,7 @@ } /** - * @param $path array|string path to get fixmes for + * @param array|string $path path to get fixmes for * @return array */ private function getPathFixmes( $path ) { @@ -128,7 +128,7 @@ } /** - * @param $path array|string path to get fixmes for + * @param array|string $path path to get fixmes for * @return array */ private function getPathNews( $path ) { @@ -136,8 +136,8 @@ } /** - * @param $path array|string - * @param $status string + * @param array|string $path + * @param string $status * @return array */ private function getStatusPath( $path, $status ) { diff --git a/backend/Subversion.php b/backend/Subversion.php index 3721275..5589dee 100644 --- a/backend/Subversion.php +++ b/backend/Subversion.php @@ -8,7 +8,7 @@ protected $mRepoPath; /** - * @param $repo string + * @param string $repo * @return SubversionAdaptor */ public static function newFromRepo( $repo ) { @@ -23,7 +23,7 @@ } /** - * @param $repoPath String Path to SVN Repo + * @param string $repoPath Path to SVN Repo */ function __construct( $repoPath ) { $this->mRepoPath = $repoPath; diff --git a/maintenance/showEmails.php b/maintenance/showEmails.php index 3650f53..ead4552 100644 --- a/maintenance/showEmails.php +++ b/maintenance/showEmails.php @@ -84,7 +84,7 @@ /** * Print the subject line. - * @param $type string|int Either '', 2, 3 or 4 + * @param string|int $type Either '', 2, 3 or 4 */ function printSubject( $type ) { $repo = $this->EmailData['repo']; diff --git a/phpcs.xml b/phpcs.xml index df4c1d0..30c7f2c 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -6,11 +6,7 @@ <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturnType" /> - <exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" /> <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> <exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName"/> <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/> @@ -18,6 +14,4 @@ <file>.</file> <arg name="extensions" value="php,php5,inc"/> <arg name="encoding" value="UTF-8"/> - <exclude-pattern>vendor</exclude-pattern> - <exclude-pattern>node_modules</exclude-pattern> </ruleset> diff --git a/ui/CodeRepoListView.php b/ui/CodeRepoListView.php index b3a4879..7ea5dcd 100644 --- a/ui/CodeRepoListView.php +++ b/ui/CodeRepoListView.php @@ -31,7 +31,7 @@ /** * @static - * @param $repo CodeRepository + * @param CodeRepository $repo * @return string */ public static function getNavItem( $repo ) { diff --git a/ui/CodeRevisionCommitter.php b/ui/CodeRevisionCommitter.php index 63366d1..da02e3d 100644 --- a/ui/CodeRevisionCommitter.php +++ b/ui/CodeRevisionCommitter.php @@ -65,8 +65,8 @@ * @param array $removeReferences Revision IDs to remove references from * @param string $commentText Comment to add to the revision * @param null|int $parent What the parent comment is (if a subcomment) - * @param $addReferenced - * @param $removeReferenced + * @param array $addReferenced + * @param array $removeReferenced * @return int Comment ID if added, else 0 */ public function revisionUpdate( $status, $addTags, $removeTags, $addSignoffs, $strikeSignoffs, diff --git a/ui/CodeRevisionListView.php b/ui/CodeRevisionListView.php index 646bd52..bf0a274 100644 --- a/ui/CodeRevisionListView.php +++ b/ui/CodeRevisionListView.php @@ -14,7 +14,7 @@ protected $filters = []; /** - * @param $repo CodeRepository|String + * @param CodeRepository|string $repo */ function __construct( $repo ) { parent::__construct( $repo ); @@ -47,7 +47,7 @@ } /** - * @param $path string + * @param string $path * @return array */ public static function pathsToArray( $path ) { @@ -55,7 +55,7 @@ } /** - * @param $path string + * @param string $path * @return string */ public static function preparePaths( $path ) { @@ -224,7 +224,7 @@ } /** - * @param $pager SvnTablePager + * @param SvnTablePager $pager * * @return string */ diff --git a/ui/CodeRevisionView.php b/ui/CodeRevisionView.php index 4fdf5e4..1732763 100644 --- a/ui/CodeRevisionView.php +++ b/ui/CodeRevisionView.php @@ -403,7 +403,7 @@ } /** - * @param $tags array + * @param array $tags * @return string */ static function listTags( $tags ) { @@ -553,9 +553,9 @@ } /** - * @param $path - * @param $rev - * @param $message + * @param string $path + * @param string $rev + * @param string $message * @return string */ protected function formatImgCell( $path, $rev, $message ) { @@ -768,7 +768,7 @@ } /** - * @param $row + * @param stdClass $row * @return string */ protected function formatReferenceInline( $row ) { diff --git a/ui/CodeView.php b/ui/CodeView.php index c7d1950..69658b3 100644 --- a/ui/CodeView.php +++ b/ui/CodeView.php @@ -90,7 +90,7 @@ /** * Formatted HTML array for properties display - * @param $fields array 'propname' => HTML data + * @param array $fields 'propname' => HTML data * @return string */ function formatMetaData( $fields ) { @@ -124,7 +124,7 @@ protected $mView; /** - * @param $view CodeView + * @param CodeView $view */ function __construct( $view ) { $this->mView = $view; diff --git a/ui/SpecialCode.php b/ui/SpecialCode.php index 22b6574..6a2844d 100644 --- a/ui/SpecialCode.php +++ b/ui/SpecialCode.php @@ -27,7 +27,7 @@ } /** - * @param $subpage string + * @param string $subpage */ public function execute( $subpage ) { global $wgUseSiteCss; diff --git a/ui/SpecialRepoAdmin.php b/ui/SpecialRepoAdmin.php index 4c4d370..176efad 100644 --- a/ui/SpecialRepoAdmin.php +++ b/ui/SpecialRepoAdmin.php @@ -31,7 +31,7 @@ } /** - * @param $subpage string + * @param string $subpage */ public function execute( $subpage ) { global $wgRequest; @@ -65,8 +65,7 @@ private $title; /** - * Constructor - * @param $t Title object referring to Special:RepoAdmin + * @param Title $t Title object referring to Special:RepoAdmin */ public function __construct( Title $t ) { $this->title = $t; diff --git a/ui/WordCloud.php b/ui/WordCloud.php index 05c3545..4a29e79 100644 --- a/ui/WordCloud.php +++ b/ui/WordCloud.php @@ -113,7 +113,7 @@ * Default text callback for word display * * @param string $word - * @param $sizeRange + * @param string $sizeRange * @return string */ public function defaultTextCallback( $word, $sizeRange ) { -- To view, visit https://gerrit.wikimedia.org/r/374068 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40aeba848e7969b219242631daced88d96939438 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeReview Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits