/**
* 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 );
}
/**
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return array
*/
public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
/**
* 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 ) {
/**
* 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(
}
/**
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return array
*/
public function getStyleURLsForDebug( ResourceLoaderContext $context ) {
/**
* 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;
/**
* 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;
/**
* 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;
* 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 ) {
/* Protected Methods */
/**
- * @param $path string
+ * @param string $path
* @return string
*/
protected function getLocalPath( $path ) {
}
/**
- * @param $path string
+ * @param string $path
* @return string
*/
protected function getRemotePath( $path ) {
* @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();
* @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 ) {
/**
* 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(
/**
* 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(
*
* @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;
* @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 ) {
* 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 ) {
/**
* Get whether CSS for this module should be flipped
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return bool
*/
public function getFlip( $context ) {
* 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;
* 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() {
}
/**
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return bool
*/
public function getFlip( $context ) {
* 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
* #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(
/**
* 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 }' ) );
*/
* 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(
*
* 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
/**
* Get the group this module is in.
*
- * @return String: Group name
+ * @return string: Group name
*/
public function getGroup() {
// Stub, override expected
/**
* 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
/**
* 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
*
* 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
/**
* 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;
* 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
* 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] ) ) {
* 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
* 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;
*
* @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;