Completed
Push — master ( 40575e...33c5d8 )
by juan
02:27
created
src/Juanber84/Services/DatabaseService.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
         }
16 16
 
17 17
         $db = file_get_contents(getenv("HOME").'/'.self::DIRECTORY.'/'.self::DB);
18
-        $jsonDb = json_decode($db,true);
18
+        $jsonDb = json_decode($db, true);
19 19
         if (!is_array($jsonDb)) {
20 20
             throw new \RuntimeException('$jsonDb must be an array.');
21 21
         }
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
         $this->generateDatabase();
29 29
         $jsonDb = $this->getProjects();
30 30
 
31
-        if (isset($jsonDb[$keyProject])){
31
+        if (isset($jsonDb[$keyProject])) {
32 32
             unset($jsonDb[$keyProject]);
33 33
             try {
34 34
                 file_put_contents(getenv("HOME").'/'.self::DIRECTORY.'/'.self::DB, json_encode($jsonDb));
35
-            } catch (\Exception $e){
35
+            } catch (\Exception $e) {
36 36
                 return false;
37 37
             }
38 38
             return true;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         try {
51 51
             file_put_contents(getenv("HOME").'/'.self::DIRECTORY.'/'.self::DB, json_encode($jsonDb));
52
-        } catch (\Exception $e){
52
+        } catch (\Exception $e) {
53 53
             return false;
54 54
         }
55 55
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -41,6 +41,9 @@
 block discarded – undo
41 41
         }
42 42
     }
43 43
 
44
+    /**
45
+     * @param string $path
46
+     */
44 47
     public function addProject($keyProject, $path)
45 48
     {
46 49
         $this->generateDatabase();
Please login to merge, or discard this patch.