Completed
Push — master ( 53fccc...bff359 )
by John
02:02
created
src/Configuration/INIConfiguration.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -10,54 +10,54 @@
 block discarded – undo
10 10
  * @package LunixREST\Configuration
11 11
  */
12 12
 class INIConfiguration implements Configuration {
13
-	/**
14
-	 * @var null
15
-	 */
16
-	protected $nameSpace;
17
-	/**
18
-	 * @var
19
-	 */
20
-	protected $filename;
21
-
22
-	/**
23
-	 * @param string $filename
24
-	 * @param string $nameSpace
25
-	 */
26
-	public function __construct($filename, $nameSpace = null){
27
-		$this->filename = $filename;
28
-		$this->nameSpace = $nameSpace;
29
-	}
30
-
31
-	/**
13
+    /**
14
+     * @var null
15
+     */
16
+    protected $nameSpace;
17
+    /**
18
+     * @var
19
+     */
20
+    protected $filename;
21
+
22
+    /**
23
+     * @param string $filename
24
+     * @param string $nameSpace
25
+     */
26
+    public function __construct($filename, $nameSpace = null){
27
+        $this->filename = $filename;
28
+        $this->nameSpace = $nameSpace;
29
+    }
30
+
31
+    /**
32 32
      * //TODO: Move throws/loading to constructor to keep with get contract
33
-	 * @param $key
34
-	 * @return mixed
35
-	 * @throws INIKeyNotFoundException
36
-	 * @throws INIParseException
37
-	 */
38
-	public function get($key){
39
-	    //TODO: Cache the file contents
40
-		$config = parse_ini_file($this->filename, (bool)$this->nameSpace);
41
-
42
-		if($config === false){
43
-			throw new INIParseException('Could not parse: ' . $this->filename, true);
44
-		}
45
-
46
-		if($this->nameSpace) {
47
-			if(isset($config[$this->nameSpace])) {
48
-				$config = $config[$this->nameSpace];
49
-			} else {
50
-				throw new INIKeyNotFoundException();
51
-			}
52
-		}
53
-
54
-		return isset($config[$key]) ? $config[$key] : null;
55
-	}
56
-
57
-	/**
58
-	 * @param $key
59
-	 */
60
-	public function set($key){
61
-		//TODO write this
62
-	}
33
+     * @param $key
34
+     * @return mixed
35
+     * @throws INIKeyNotFoundException
36
+     * @throws INIParseException
37
+     */
38
+    public function get($key){
39
+        //TODO: Cache the file contents
40
+        $config = parse_ini_file($this->filename, (bool)$this->nameSpace);
41
+
42
+        if($config === false){
43
+            throw new INIParseException('Could not parse: ' . $this->filename, true);
44
+        }
45
+
46
+        if($this->nameSpace) {
47
+            if(isset($config[$this->nameSpace])) {
48
+                $config = $config[$this->nameSpace];
49
+            } else {
50
+                throw new INIKeyNotFoundException();
51
+            }
52
+        }
53
+
54
+        return isset($config[$key]) ? $config[$key] : null;
55
+    }
56
+
57
+    /**
58
+     * @param $key
59
+     */
60
+    public function set($key){
61
+        //TODO write this
62
+    }
63 63
 }
Please login to merge, or discard this patch.