Completed
Push — master ( b3acba...04c2f9 )
by Matteo
02:23
created
src/Flat/Database.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -46,6 +46,9 @@  discard block
 block discarded – undo
46 46
         return $this->getOrCreateCollection($name);
47 47
     }
48 48
 
49
+    /**
50
+     * @param string $name
51
+     */
49 52
     public function getOrCreateCollection($name)
50 53
     {
51 54
         if (isset($this->collections[$name])) {
@@ -63,6 +66,9 @@  discard block
 block discarded – undo
63 66
         return $this->collections[$name] = $this->newCollection($store, $name);
64 67
     }
65 68
 
69
+    /**
70
+     * @param string $name
71
+     */
66 72
     public function dropCollection($name)
67 73
     {
68 74
         $this->engine->destroy($name);
Please login to merge, or discard this patch.
src/Flat/Storage/DocumentStore.php 1 patch
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -3,10 +3,6 @@
 block discarded – undo
3 3
 namespace Mattbit\Flat\Storage;
4 4
 
5 5
 use Mattbit\Flat\Model\DocumentInterface;
6
-use Mattbit\Flat\Storage\Filesystem\FilesystemCursor;
7
-
8
-use Mattbit\Flat\Storage\EncoderInterface;
9
-
10 6
 use Mattbit\Flat\Exception\DuplicateKeyException;
11 7
 
12 8
 class DocumentStore implements \IteratorAggregate
Please login to merge, or discard this patch.
src/Flat/Storage/FilesystemIterator.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@
 block discarded – undo
12 12
      */
13 13
     protected $encoder;
14 14
 
15
+    /**
16
+     * @param string $path
17
+     */
15 18
     public function __construct(EncoderInterface $encoder, $path)
16 19
     {
17 20
         $this->encoder = $encoder;
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Mattbit\Flat\Storage;
4 4
 
5
-use Mattbit\Flat\Model\Document;
6 5
 use Mattbit\Flat\Storage\EncoderInterface;
7 6
 
8 7
 class FilesystemIterator implements \Iterator {
Please login to merge, or discard this patch.
src/Flat/Storage/JsonEncoder.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -48,6 +48,9 @@
 block discarded – undo
48 48
         return $document;
49 49
     }
50 50
 
51
+    /**
52
+     * @param DocumentInterface $document
53
+     */
51 54
     public function flatten($document, $prepend = '')
52 55
     {
53 56
         $results = [];
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $data = json_decode($data, true);
35 35
 
36
-        if (!isset($data['_doc']) ){
36
+        if (!isset($data['_doc'])) {
37 37
             throw new DecodeException("Document decoding failed because of bad/corrupted data.");
38 38
         }
39 39
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $results = [];
54 54
 
55 55
         foreach ($document as $key => $value) {
56
-            if (is_array($value) && ! empty($value)) {
56
+            if (is_array($value) && !empty($value)) {
57 57
                 $results = array_merge($results, $this->flatten($value, $prepend.$key.'.'));
58 58
             } else {
59 59
                 $results[$prepend.$key] = $value;
Please login to merge, or discard this patch.
src/Flat/Model/Document.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
             // If the key doesn't exist at this depth, we will just create an empty array
68 68
             // to hold the next value, allowing us to create the arrays to hold final
69 69
             // values at the correct depth. Then we'll keep digging into the array.
70
-            if (! isset($attributes[$key]) || ! is_array($attributes[$key])) {
70
+            if (!isset($attributes[$key]) || !is_array($attributes[$key])) {
71 71
                 $attributes[$key] = [];
72 72
             }
73 73
             $attributes = &$attributes[$key];
Please login to merge, or discard this patch.
src/Flat/Storage/FilesystemEngine.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,6 +84,6 @@
 block discarded – undo
84 84
 
85 85
     protected function path($id, $collection, $ext = '.data')
86 86
     {
87
-        return $this->namespace . DIRECTORY_SEPARATOR . $collection . DIRECTORY_SEPARATOR . $id . $ext;
87
+        return $this->namespace.DIRECTORY_SEPARATOR.$collection.DIRECTORY_SEPARATOR.$id.$ext;
88 88
     }
89 89
 }
Please login to merge, or discard this patch.