Completed
Push — master ( a79ded...c3a156 )
by Alfred
01:48
created
ConfigManager.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -11,18 +11,18 @@  discard block
 block discarded – undo
11 11
 {
12 12
 const PHP_TAB = "\t";
13 13
     /**
14
-    * Chemin complet du fichier de configuration
15
-    */
14
+     * Chemin complet du fichier de configuration
15
+     */
16 16
     private $targetFile;
17 17
     private $Options = [];
18 18
     /**
19
-    * tableau multidimensionnel contenant les donnée de configuration, initialement
20
-    * chargées depuis le fichier
21
-    */
19
+     * tableau multidimensionnel contenant les donnée de configuration, initialement
20
+     * chargées depuis le fichier
21
+     */
22 22
     private $Config = [];
23 23
     /**
24
-    * processeurs de fichier pris en charge par l'application
25
-    */
24
+     * processeurs de fichier pris en charge par l'application
25
+     */
26 26
     private $availableDrivers = array('JSON', 'PHP','INI','YML');
27 27
 
28 28
     private $defaultSection = 'runtime';
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
             trigger_error($a->getMessage(),E_USER_ERROR);
49 49
         }
50 50
     }
51
- /**
52
-     * @param $section
53
-     * @param $item
54
-     * @return array|bool|mixed
55
-     */
51
+  /**
52
+   * @param $section
53
+   * @param $item
54
+   * @return array|bool|mixed
55
+   */
56 56
     public function get($section=null, $item=null)
57 57
     {
58 58
         if($item) $item = trim(strtolower($item));
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
         return $this->Config[$section][$item];
82 82
     }
83 83
 
84
- /**
85
-     * @param $section
86
-     * @param $item
87
-     * @param $value
88
-     * @return bool
89
-     */
84
+  /**
85
+   * @param $section
86
+   * @param $item
87
+   * @param $value
88
+   * @return bool
89
+   */
90 90
     public function set($section,$item=null,$value=null)
91 91
     { 
92 92
         ob_start();
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             case 1:
98 98
                 if(!is_array($arguments[0])) return false;
99 99
                 $item=array_change_key_case($arguments[0], CASE_LOWER); $section=null; $value=null;	
100
-		break;
100
+    break;
101 101
             case 2:
102 102
                 if(is_array($arguments[0])) return false;
103 103
                 $_arg = strtolower(trim($arguments[0]));
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
             $Options['driver'] = strtoupper(pathinfo($Options['filename'], PATHINFO_EXTENSION));
217 217
         else
218 218
             $Options['filename']= $Options['filename'].'.'.strtolower($default['driver']);
219
-	     if(!in_array($Options['driver'],$this->$availableDrivers))
219
+        if(!in_array($Options['driver'],$this->$availableDrivers))
220 220
             throw new Exception('ERROR: driver "'.$Options['driver'].'" not supported');
221
-	    $this->Options = array_merge($default,$Options);
221
+      $this->Options = array_merge($default,$Options);
222 222
         return $this->Options;
223 223
     }
224 224
     /**
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         }
251 251
         return $path;
252 252
     }
253
-	  /**
253
+    /**
254 254
      * @param array $options
255 255
      * @return mixed
256 256
      */
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 /**
288 288
      * @return bool
289 289
      */
290
-     private function Save()
290
+      private function Save()
291 291
     {
292 292
         if( !is_writeable( $this->targetFile ) ) @chmod($this->targetFile,0775);
293 293
         $content = null;
Please login to merge, or discard this patch.