]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/helper/ApplicationUtils.php
Apply PHP Code Beautifier on source code for linter automatic fixes
[github/shaarli/Shaarli.git] / application / helper / ApplicationUtils.php
index 4b34e114caf380d7c6cf28512c908c200f299b88..212dd8e2dc7578aa6da6a3f8d403fff319ae3f42 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 namespace Shaarli\Helper;
 
 use Exception;
@@ -16,7 +17,7 @@ class ApplicationUtils
 
     public static $GITHUB_URL = 'https://github.com/shaarli/Shaarli';
     public static $GIT_RAW_URL = 'https://raw.githubusercontent.com/shaarli/Shaarli';
-    public static $GIT_BRANCHES = array('latest', 'stable');
+    public static $GIT_BRANCHES = ['latest', 'stable'];
     private static $VERSION_START_TAG = '<?php /* ';
     private static $VERSION_END_TAG = ' */ ?>';
 
@@ -64,8 +65,8 @@ class ApplicationUtils
         }
 
         return str_replace(
-            array(self::$VERSION_START_TAG, self::$VERSION_END_TAG, PHP_EOL),
-            array('', '', ''),
+            [self::$VERSION_START_TAG, self::$VERSION_END_TAG, PHP_EOL],
+            ['', '', ''],
             $data
         );
     }
@@ -184,13 +185,15 @@ class ApplicationUtils
         $rainTplDir = rtrim($conf->get('resource.raintpl_tpl'), '/');
 
         // Check script and template directories are readable
-        foreach ([
-                     'application',
-                     'inc',
-                     'plugins',
-                     $rainTplDir,
-                     $rainTplDir . '/' . $conf->get('resource.theme'),
-                 ] as $path) {
+        foreach (
+            [
+            'application',
+            'inc',
+            'plugins',
+            $rainTplDir,
+            $rainTplDir . '/' . $conf->get('resource.theme'),
+            ] as $path
+        ) {
             if (!is_readable(realpath($path))) {
                 $errors[] = '"' . $path . '" ' . t('directory is not readable');
             }
@@ -203,10 +206,10 @@ class ApplicationUtils
             ];
         } else {
             $folders = [
-                $conf->get('resource.thumbnails_cache'),
-                $conf->get('resource.data_dir'),
-                $conf->get('resource.page_cache'),
-                $conf->get('resource.raintpl_tmp'),
+            $conf->get('resource.thumbnails_cache'),
+            $conf->get('resource.data_dir'),
+            $conf->get('resource.page_cache'),
+            $conf->get('resource.raintpl_tmp'),
             ];
         }
 
@@ -224,13 +227,15 @@ class ApplicationUtils
         }
 
         // Check configuration files are readable and writable
-        foreach (array(
-                     $conf->getConfigFileExt(),
-                     $conf->get('resource.datastore'),
-                     $conf->get('resource.ban_file'),
-                     $conf->get('resource.log'),
-                     $conf->get('resource.update_check'),
-                 ) as $path) {
+        foreach (
+            [
+                 $conf->getConfigFileExt(),
+                 $conf->get('resource.datastore'),
+                 $conf->get('resource.ban_file'),
+                 $conf->get('resource.log'),
+                 $conf->get('resource.update_check'),
+             ] as $path
+        ) {
             if (!is_file(realpath($path))) {
                 # the file may not exist yet
                 continue;