Consistently follow conventions for documenting parameters
authorOri Livneh <ori@wikimedia.org>
Fri, 13 Sep 2013 04:50:45 +0000 (21:50 -0700)
committerOri Livneh <ori@wikimedia.org>
Fri, 13 Sep 2013 04:50:45 +0000 (21:50 -0700)
Per MW:CC/PHP, the type goes before the variable name, and built-in types are
not uppercase.

Change-Id: Ibb753acd9529ace3579d57654adc47673fa49719

includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderModule.php

index af533c6..10c25f0 100644 (file)
@@ -259,8 +259,8 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Gets all scripts for a given context concatenated together.
         *
-        * @param $context ResourceLoaderContext: Context in which to generate script
-        * @return String: JavaScript code for $context
+        * @param ResourceLoaderContext $context Context in which to generate script
+        * @return string: JavaScript code for $context
         */
        public function getScript( ResourceLoaderContext $context ) {
                $files = $this->getScriptFiles( $context );
@@ -268,7 +268,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        }
 
        /**
-        * @param $context ResourceLoaderContext
+        * @param ResourceLoaderContext $context
         * @return array
         */
        public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
@@ -289,7 +289,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Gets loader script.
         *
-        * @return String: JavaScript code to be added to startup module
+        * @return string: JavaScript code to be added to startup module
         */
        public function getLoaderScript() {
                if ( count( $this->loaderScripts ) == 0 ) {
@@ -301,8 +301,8 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Gets all styles for a given context concatenated together.
         *
-        * @param $context ResourceLoaderContext: Context in which to generate styles
-        * @return String: CSS code for $context
+        * @param ResourceLoaderContext $context Context in which to generate styles
+        * @return string: CSS code for $context
         */
        public function getStyles( ResourceLoaderContext $context ) {
                $styles = $this->readStyleFiles(
@@ -330,7 +330,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        }
 
        /**
-        * @param $context ResourceLoaderContext
+        * @param ResourceLoaderContext $context
         * @return array
         */
        public function getStyleURLsForDebug( ResourceLoaderContext $context ) {
@@ -347,7 +347,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Gets list of message keys used by this module.
         *
-        * @return Array: List of message keys
+        * @return array: List of message keys
         */
        public function getMessages() {
                return $this->messages;
@@ -356,7 +356,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Gets the name of the group this module should be loaded in.
         *
-        * @return String: Group name
+        * @return string: Group name
         */
        public function getGroup() {
                return $this->group;
@@ -372,7 +372,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Gets list of names of modules this module depends on.
         *
-        * @return Array: List of module names
+        * @return array: List of module names
         */
        public function getDependencies() {
                return $this->dependencies;
@@ -394,9 +394,9 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * calculations on files relevant to the given language, skin and debug
         * mode.
         *
-        * @param $context ResourceLoaderContext: Context in which to calculate
+        * @param ResourceLoaderContext $context Context in which to calculate
         *     the modified time
-        * @return Integer: UNIX timestamp
+        * @return int: UNIX timestamp
         * @see ResourceLoaderModule::getFileDependencies
         */
        public function getModifiedTime( ResourceLoaderContext $context ) {
@@ -455,7 +455,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /* Protected Methods */
 
        /**
-        * @param $path string
+        * @param string $path
         * @return string
         */
        protected function getLocalPath( $path ) {
@@ -463,7 +463,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        }
 
        /**
-        * @param $path string
+        * @param string $path
         * @return string
         */
        protected function getRemotePath( $path ) {
@@ -476,8 +476,8 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * @param array $list List of file paths in any combination of index/path
         *     or path/options pairs
         * @param string $option option name
-        * @param $default Mixed: default value if the option isn't set
-        * @return Array: List of file paths, collated by $option
+        * @param mixed $default default value if the option isn't set
+        * @return array: List of file paths, collated by $option
         */
        protected static function collateFilePathListByOption( array $list, $option, $default ) {
                $collatedFiles = array();
@@ -506,7 +506,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * @param array $list List of lists to select from
         * @param string $key Key to look for in $map
         * @param string $fallback Key to look for in $list if $key doesn't exist
-        * @return Array: List of elements from $map which matched $key or $fallback,
+        * @return array: List of elements from $map which matched $key or $fallback,
         *     or an empty list in case of no match
         */
        protected static function tryForKey( array $list, $key, $fallback = null ) {
@@ -524,8 +524,8 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Gets a list of file paths for all scripts in this module, in order of propper execution.
         *
-        * @param $context ResourceLoaderContext: Context
-        * @return Array: List of file paths
+        * @param ResourceLoaderContext $context
+        * @return array: List of file paths
         */
        protected function getScriptFiles( ResourceLoaderContext $context ) {
                $files = array_merge(
@@ -543,8 +543,8 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Gets a list of file paths for all styles in this module, in order of propper inclusion.
         *
-        * @param $context ResourceLoaderContext: Context
-        * @return Array: List of file paths
+        * @param ResourceLoaderContext $context
+        * @return array: List of file paths
         */
        protected function getStyleFiles( ResourceLoaderContext $context ) {
                return array_merge_recursive(
@@ -560,7 +560,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         *
         * @param array $scripts List of file paths to scripts to read, remap and concetenate
         * @throws MWException
-        * @return String: Concatenated and remapped JavaScript data from $scripts
+        * @return string: Concatenated and remapped JavaScript data from $scripts
         */
        protected function readScriptFiles( array $scripts ) {
                global $wgResourceLoaderValidateStaticJS;
@@ -591,9 +591,9 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * @param array $styles List of media type/list of file paths pairs, to read, remap and
         * concetenate
         *
-        * @param $flip bool
+        * @param bool $flip
         *
-        * @return Array: List of concatenated and remapped CSS data from $styles,
+        * @return array: List of concatenated and remapped CSS data from $styles,
         *     keyed by media type
         */
        protected function readStyleFiles( array $styles, $flip ) {
@@ -620,9 +620,9 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * This method can be used as a callback for array_map()
         *
         * @param string $path File path of style file to read
-        * @param $flip bool
+        * @param bool $flip
         *
-        * @return String: CSS data in script file
+        * @return string: CSS data in script file
         * @throws MWException if the file doesn't exist
         */
        protected function readStyleFile( $path, $flip ) {
@@ -655,7 +655,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
 
        /**
         * Get whether CSS for this module should be flipped
-        * @param $context ResourceLoaderContext
+        * @param ResourceLoaderContext $context
         * @return bool
         */
        public function getFlip( $context ) {
index 9847ac0..298f1fe 100644 (file)
@@ -71,7 +71,7 @@ abstract class ResourceLoaderModule {
         * Get this module's name. This is set when the module is registered
         * with ResourceLoader::register()
         *
-        * @return Mixed: Name (string) or null if no name was set
+        * @return mixed: Name (string) or null if no name was set
         */
        public function getName() {
                return $this->name;
@@ -91,7 +91,7 @@ abstract class ResourceLoaderModule {
         * Get this module's origin. This is set when the module is registered
         * with ResourceLoader::register()
         *
-        * @return Int ResourceLoaderModule class constant, the subclass default
+        * @return int: ResourceLoaderModule class constant, the subclass default
         *     if not set manually
         */
        public function getOrigin() {
@@ -109,7 +109,7 @@ abstract class ResourceLoaderModule {
        }
 
        /**
-        * @param $context ResourceLoaderContext
+        * @param ResourceLoaderContext $context
         * @return bool
         */
        public function getFlip( $context ) {
@@ -122,8 +122,8 @@ abstract class ResourceLoaderModule {
         * Get all JS for this module for a given language and skin.
         * Includes all relevant JS except loader scripts.
         *
-        * @param $context ResourceLoaderContext: Context object
-        * @return String: JavaScript code
+        * @param ResourceLoaderContext $context
+        * @return string: JavaScript code
         */
        public function getScript( ResourceLoaderContext $context ) {
                // Stub, override expected
@@ -141,8 +141,8 @@ abstract class ResourceLoaderModule {
         * #2 is important to prevent an infinite loop, therefore this function
         * MUST return either an only= URL or a non-load.php URL.
         *
-        * @param $context ResourceLoaderContext: Context object
-        * @return Array of URLs
+        * @param ResourceLoaderContext $context
+        * @return array: Array of URLs
         */
        public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
                $url = ResourceLoader::makeLoaderURL(
@@ -172,8 +172,8 @@ abstract class ResourceLoaderModule {
        /**
         * Get all CSS for this module for a given skin.
         *
-        * @param $context ResourceLoaderContext: Context object
-        * @return Array: List of CSS strings or array of CSS strings keyed by media type.
+        * @param ResourceLoaderContext $context
+        * @return array: List of CSS strings or array of CSS strings keyed by media type.
         *  like array( 'screen' => '.foo { width: 0 }' );
         *  or array( 'screen' => array( '.foo { width: 0 }' ) );
         */
@@ -188,8 +188,8 @@ abstract class ResourceLoaderModule {
         * the module, but file-based modules will want to override this to
         * load the files directly. See also getScriptURLsForDebug()
         *
-        * @param $context ResourceLoaderContext: Context object
-        * @return Array: array( mediaType => array( URL1, URL2, ... ), ... )
+        * @param ResourceLoaderContext $context
+        * @return array: array( mediaType => array( URL1, URL2, ... ), ... )
         */
        public function getStyleURLsForDebug( ResourceLoaderContext $context ) {
                $url = ResourceLoader::makeLoaderURL(
@@ -211,7 +211,7 @@ abstract class ResourceLoaderModule {
         *
         * To get a JSON blob with messages, use MessageBlobStore::get()
         *
-        * @return Array: List of message keys. Keys may occur more than once
+        * @return array: List of message keys. Keys may occur more than once
         */
        public function getMessages() {
                // Stub, override expected
@@ -221,7 +221,7 @@ abstract class ResourceLoaderModule {
        /**
         * Get the group this module is in.
         *
-        * @return String: Group name
+        * @return string: Group name
         */
        public function getGroup() {
                // Stub, override expected
@@ -231,7 +231,7 @@ abstract class ResourceLoaderModule {
        /**
         * Get the origin of this module. Should only be overridden for foreign modules.
         *
-        * @return String: Origin name, 'local' for local modules
+        * @return string: Origin name, 'local' for local modules
         */
        public function getSource() {
                // Stub, override expected
@@ -263,7 +263,7 @@ abstract class ResourceLoaderModule {
        /**
         * Get the loader JS for this module, if set.
         *
-        * @return Mixed: JavaScript loader code as a string or boolean false if no custom loader set
+        * @return mixed: JavaScript loader code as a string or boolean false if no custom loader set
         */
        public function getLoaderScript() {
                // Stub, override expected
@@ -278,7 +278,7 @@ abstract class ResourceLoaderModule {
         *
         * To add dependencies dynamically on the client side, use a custom
         * loader script, see getLoaderScript()
-        * @return Array: List of module names as strings
+        * @return array: List of module names as strings
         */
        public function getDependencies() {
                // Stub, override expected
@@ -288,7 +288,7 @@ abstract class ResourceLoaderModule {
        /**
         * Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']
         *
-        * @return array of strings
+        * @return array: Array of strings
         */
        public function getTargets() {
                return $this->targets;
@@ -299,7 +299,7 @@ abstract class ResourceLoaderModule {
         * Currently these are only image files referenced by the module's CSS.
         *
         * @param string $skin Skin name
-        * @return Array: List of files
+        * @return array: List of files
         */
        public function getFileDependencies( $skin ) {
                // Try in-object cache first
@@ -335,7 +335,7 @@ abstract class ResourceLoaderModule {
         * Get the last modification timestamp of the message blob for this
         * module in a given language.
         * @param string $lang Language code
-        * @return Integer: UNIX timestamp, or 0 if the module doesn't have messages
+        * @return int: UNIX timestamp, or 0 if the module doesn't have messages
         */
        public function getMsgBlobMtime( $lang ) {
                if ( !isset( $this->msgBlobMtime[$lang] ) ) {
@@ -382,8 +382,8 @@ abstract class ResourceLoaderModule {
         * If you want this to happen, you'll need to call getMsgBlobMtime()
         * yourself and take its result into consideration.
         *
-        * @param $context ResourceLoaderContext: Context object
-        * @return Integer: UNIX timestamp
+        * @param ResourceLoaderContext $context
+        * @return int: UNIX timestamp
         */
        public function getModifiedTime( ResourceLoaderContext $context ) {
                // 0 would mean now
@@ -396,8 +396,8 @@ abstract class ResourceLoaderModule {
         * definitely going to be empty, it should override this method to
         * return true in that case. Callers may optimize the request for this
         * module away if this function returns true.
-        * @param $context ResourceLoaderContext: Context object
-        * @return Boolean
+        * @param ResourceLoaderContext $context
+        * @return bool
         */
        public function isKnownEmpty( ResourceLoaderContext $context ) {
                return false;
@@ -413,7 +413,7 @@ abstract class ResourceLoaderModule {
         *
         * @param string $fileName
         * @param string $contents
-        * @return string JS with the original, or a replacement error
+        * @return string: JS with the original, or a replacement error
         */
        protected function validateScriptFile( $fileName, $contents ) {
                global $wgResourceLoaderValidateJS;