Merge "phan: Add internal stubs for imagick, pcntl, redis & sockets"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderImage.php
index 8cd5b19..2e2da70 100644 (file)
@@ -20,6 +20,8 @@
  * @file
  */
 
+use MediaWiki\Shell\Shell;
+
 /**
  * Class encapsulating an image used in a ResourceLoaderImageModule.
  *
@@ -38,6 +40,21 @@ class ResourceLoaderImage {
                'jpg' => 'image/jpg',
        ];
 
+       /** @var string */
+       private $name;
+       /** @var string */
+       private $module;
+       /** @var string|array */
+       private $descriptor;
+       /** @var string */
+       private $basePath;
+       /** @var array */
+       private $variants;
+       /** @var string|null */
+       private $defaultColor;
+       /** @var string */
+       private $extension;
+
        /**
         * @param string $name Image name
         * @param string $module Module name
@@ -73,7 +90,7 @@ class ResourceLoaderImage {
                }
                // Remove 'deprecated' key
                if ( is_array( $this->descriptor ) ) {
-                       unset( $this->descriptor[ 'deprecated' ] );
+                       unset( $this->descriptor['deprecated'] );
                }
 
                // Ensure that all files have common extension.
@@ -373,7 +390,7 @@ class ResourceLoaderImage {
                if ( strpos( $wgSVGConverter, 'rsvg' ) === 0 ) {
                        $command = 'rsvg-convert';
                        if ( $wgSVGConverterPath ) {
-                               $command = wfEscapeShellArg( "$wgSVGConverterPath/" ) . $command;
+                               $command = Shell::escape( "$wgSVGConverterPath/" ) . $command;
                        }
 
                        $process = proc_open(