protected $contextTitle = false;
/** @var array */
- protected $mAttribs = array();
+ protected $mAttribs = [];
/** @var bool */
static private $modeMapping = false;
$context = RequestContext::getMainAndWarn( __METHOD__ );
}
if ( !$mode ) {
- $galleryOpions = $context->getConfig()->get( 'GalleryOptions' );
- $mode = $galleryOpions['mode'];
+ $galleryOptions = $context->getConfig()->get( 'GalleryOptions' );
+ $mode = $galleryOptions['mode'];
}
$mode = $wgContLang->lc( $mode );
private static function loadModes() {
if ( self::$modeMapping === false ) {
- self::$modeMapping = array(
+ self::$modeMapping = [
'traditional' => 'TraditionalImageGallery',
'nolines' => 'NolinesImageGallery',
'packed' => 'PackedImageGallery',
'packed-hover' => 'PackedHoverImageGallery',
'packed-overlay' => 'PackedOverlayImageGallery',
- );
+ 'slideshow' => 'SlideshowImageGallery',
+ ];
// Allow extensions to make a new gallery format.
- Hooks::run( 'GalleryGetModes', array( &self::$modeMapping ) );
+ Hooks::run( 'GalleryGetModes', [ &self::$modeMapping ] );
}
}
}
$galleryOptions = $this->getConfig()->get( 'GalleryOptions' );
- $this->mImages = array();
+ $this->mImages = [];
$this->mShowBytes = $galleryOptions['showBytes'];
$this->mShowFilename = true;
$this->mParser = false;
* @param string $link Override image link (optional)
* @param array $handlerOpts Array of options for image handler (aka page number)
*/
- function add( $title, $html = '', $alt = '', $link = '', $handlerOpts = array() ) {
+ function add( $title, $html = '', $alt = '', $link = '', $handlerOpts = [] ) {
if ( $title instanceof File ) {
// Old calling convention
$title = $title->getTitle();
}
- $this->mImages[] = array( $title, $html, $alt, $link, $handlerOpts );
+ $this->mImages[] = [ $title, $html, $alt, $link, $handlerOpts ];
wfDebug( 'ImageGallery::add ' . $title->getText() . "\n" );
}
* @param string $link Override image link (optional)
* @param array $handlerOpts Array of options for image handler (aka page number)
*/
- function insert( $title, $html = '', $alt = '', $link = '', $handlerOpts = array() ) {
+ function insert( $title, $html = '', $alt = '', $link = '', $handlerOpts = [] ) {
if ( $title instanceof File ) {
// Old calling convention
$title = $title->getTitle();
}
- array_unshift( $this->mImages, array( &$title, $html, $alt, $link, $handlerOpts ) );
+ array_unshift( $this->mImages, [ &$title, $html, $alt, $link, $handlerOpts ] );
}
/**