Merge "Add SVG versions of enhanced recent changes collapse/show arrows"
[lhc/web/wiklou.git] / includes / gallery / PackedImageGallery.php
index 963ee6b..bb55c89 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 class PackedImageGallery extends TraditionalImageGallery {
-
        function __construct( $mode = 'traditional' ) {
                parent::__construct( $mode );
                // Does not support per row option.
@@ -49,6 +48,7 @@ class PackedImageGallery extends TraditionalImageGallery {
 
        /**
         * @param File $img The file being transformed. May be false
+        * @return array
         */
        protected function getThumbParams( $img ) {
                if ( $img && $img->getMediaType() === MEDIATYPE_AUDIO ) {
@@ -58,6 +58,7 @@ class PackedImageGallery extends TraditionalImageGallery {
                        // factor, so use random big number.
                        $width = $this->mHeights * 10 + 100;
                }
+
                // self::SCALE_FACTOR so the js has some room to manipulate sizes.
                return array(
                        'width' => $width * self::SCALE_FACTOR,
@@ -70,14 +71,18 @@ class PackedImageGallery extends TraditionalImageGallery {
                if ( $thumbWidth < 60 * self::SCALE_FACTOR ) {
                        $thumbWidth = 60 * self::SCALE_FACTOR;
                }
+
                return $thumbWidth / self::SCALE_FACTOR + $this->getThumbPadding();
        }
 
        /**
-        * @param MediaTransformOutput|bool $thumb the thumbnail, or false if no thumb (which can happen)
+        * @param MediaTransformOutput|bool $thumb the thumbnail, or false if no
+        *   thumb (which can happen)
+        * @return float
         */
        protected function getGBWidth( $thumb ) {
                $thumbWidth = $thumb ? $thumb->getWidth() : $this->mWidths * self::SCALE_FACTOR;
+
                return $this->getThumbDivWidth( $thumbWidth ) + $this->getGBPadding();
        }