changeset 63:1c32ece9acde

Some residual array() => [] conversions.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 13 Sep 2016 00:09:46 +0300
parents 3f60a5f5b4b3
children 9a01e14b27ef
files mgallery.php mgtool.php
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mgallery.php	Tue Sep 13 00:03:06 2016 +0300
+++ b/mgallery.php	Tue Sep 13 00:09:46 2016 +0300
@@ -293,7 +293,7 @@
 
 function mgPrintBreadCrumbs($galData)
 {
-  $res = array();
+  $res = [];
   if ($galData["caption"])
     $res[] = mgGetBreadCrump("naviBreadCrumbCurr", $galData);
 
@@ -365,7 +365,7 @@
 if (!isset($galData) || !isset($galEntries) ||
     !isset($galAlbumsIndex) || !isset($galImagesIndex))
 {
-  cmPrintPageHeader(mgGetVal(array("title_prefix", "title_sep"), "%1%2")."ERROR!");
+  cmPrintPageHeader(mgGetVal(["title_prefix", "title_sep"], "%1%2")."ERROR!");
 
   echo
     "<h1>Gallery error</h1>\n".
@@ -438,15 +438,15 @@
   "</div>\n".
   "<div class=\"imageCaption\">".mgGetArr($data, "caption", "%1", "")."</div>\n";
 
-  $list = array(
-    mgGetArr($data, array("width", "height"), "<span class=\"infoDimensions\"><b>%1</b> x <b>%2</b> px</span>", NULL),
+  $list = [
+    mgGetArr($data, ["width", "height"], "<span class=\"infoDimensions\"><b>%1</b> x <b>%2</b> px</span>", NULL),
     mgGetArr($data, "model", "<span class=\"infoModel\"><b>%1</b></span>", NULL),
     mgGetArr($data, "fnumber", "<span class=\"infoFNumber\"><b>f/%1</b></span>", NULL),
     mgGetArr($data, "exposure", "<span class=\"infoExposure\"><b>%1</b> sec</span>", NULL, NULL),
     mgGetArr($data, "iso", "<span class=\"infoISO\">ISO <b>%1</b></span>", NULL),
     mgGetArr($data, "focallength", "<span class=\"infoFocalLength\">F-L <b>%1</b>mm</span>", NULL),
     mgGetArr($data, "lensmodel", "<span class=\"infoLensModel\"><i>%1</i></span>", NULL),
-  );
+  ];
 
   echo
     "<div class=\"infoBox\">\n".
--- a/mgtool.php	Tue Sep 13 00:03:06 2016 +0300
+++ b/mgtool.php	Tue Sep 13 00:09:46 2016 +0300
@@ -435,11 +435,11 @@
     if (is_dir($realFile))
     {
       if ($dirFile[0] != "." && $dirFile != $galTNPath)
-        $entries[$dirFile] = array("type" => 1, "base" => $dirFile, "ext" => "", "mtime" => filemtime($realFile));
+        $entries[$dirFile] = ["type" => 1, "base" => $dirFile, "ext" => "", "mtime" => filemtime($realFile)];
     }
     else
     if (preg_match("/^([^\/]+)(".mgGetSetting("format_exts").")$/i", $dirFile, $dirMatch))
-      $entries[$dirFile] = array("type" => 0, "base" => $dirMatch[1], "ext" => $dirMatch[2], "mtime" => filemtime($realFile), "hide" => false);
+      $entries[$dirFile] = ["type" => 0, "base" => $dirMatch[1], "ext" => $dirMatch[2], "mtime" => filemtime($realFile), "hide" => false];
   }
   closedir($dirHandle);
 
@@ -495,7 +495,7 @@
       if (array_key_exists($ename, $galEntries))
         $galEntry = &$galEntries[$ename];
       else
-        $galEntry = array();
+        $galEntry = [];
 
       mgCheckQuit(TRUE);
 
@@ -557,7 +557,7 @@
           {
             echo "1";
             mgConvertImage($efilename, $medFilename,
-              array(mgGetSetting("med_width"), mgGetSetting("med_height")),
+              [mgGetSetting("med_width"), mgGetSetting("med_height")],
               "JPEG", mgGetSetting("med_quality"), TRUE);
           }
 
@@ -565,7 +565,7 @@
           {
             echo "2";
             mgConvertImage($efilename, $tnFilename,
-              array(mgGetSetting("tn_width"), mgGetSetting("tn_height")),
+              [mgGetSetting("tn_width"), mgGetSetting("tn_height")],
               "JPEG", mgGetSetting("tn_quality"), TRUE);
           }
         }