Completed
Push — master ( b408c6...9b0fcb )
by Michał
01:56
created
src/Barenote/Endpoint/Authentication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
                 'email'    => $email
47 47
             ]
48 48
         );
49
-        $url    = self::URL_REGISTER;
49
+        $url = self::URL_REGISTER;
50 50
 
51 51
         $response = $this->transport->sendRequest($method, $url, $body);
52 52
 
Please login to merge, or discard this patch.
src/Barenote/Domain/Credentials.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,6 +45,6 @@
 block discarded – undo
45 45
 
46 46
     public function jsonSerialize()
47 47
     {
48
-        return ['username' => $this->username, 'password' => $this->password];
48
+        return [ 'username' => $this->username, 'password' => $this->password ];
49 49
     }
50 50
 }
51 51
\ No newline at end of file
Please login to merge, or discard this patch.
src/Barenote/Collection/NoteCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function find(NoteId $id)
27 27
     {
28 28
         return $this->filter(
29
-            function (Note $note) use ($id) {
29
+            function(Note $note) use ($id) {
30 30
                 return $note->getId() === $id;
31 31
             }
32 32
         );
Please login to merge, or discard this patch.
src/Barenote/Collection/ArrayCollection.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      * ArrayCollection constructor.
20 20
      * @param array $elements
21 21
      */
22
-    public function __construct(array $elements = [])
22
+    public function __construct(array $elements = [ ])
23 23
     {
24 24
         $this->elements = $elements;
25 25
     }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function add($value)
48 48
     {
49
-        $this->elements[] = $value;
49
+        $this->elements[ ] = $value;
50 50
     }
51 51
 
52 52
     /**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function clear()
56 56
     {
57
-        $this->elements = [];
57
+        $this->elements = [ ];
58 58
     }
59 59
 
60 60
     /**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function containsKey($key)
90 90
     {
91
-        return isset($this->elements[$key]) || array_key_exists($key, $this->elements);
91
+        return isset($this->elements[ $key ]) || array_key_exists($key, $this->elements);
92 92
     }
93 93
 
94 94
     public function offsetGet($offset)
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function get($key)
104 104
     {
105
-        if (isset($this->elements[$key])) {
106
-            return $this->elements[$key];
105
+        if (isset($this->elements[ $key ])) {
106
+            return $this->elements[ $key ];
107 107
         }
108 108
 
109 109
         return null;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function set($key, $element)
122 122
     {
123
-        $this->elements[$key] = $element;
123
+        $this->elements[ $key ] = $element;
124 124
     }
125 125
 
126 126
     public function offsetUnset($offset)
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 
131 131
     public function remove($key)
132 132
     {
133
-        if (isset($this->elements[$key]) || array_key_exists($key, $this->elements)) {
134
-            $removed = $this->elements[$key];
135
-            unset($this->elements[$key]);
133
+        if (isset($this->elements[ $key ]) || array_key_exists($key, $this->elements)) {
134
+            $removed = $this->elements[ $key ];
135
+            unset($this->elements[ $key ]);
136 136
 
137 137
             return $removed;
138 138
         }
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
 
169 169
     protected function extractProperties($propertyFetchMethod)
170 170
     {
171
-        $values = [];
171
+        $values = [ ];
172 172
         $this->forAll(
173
-            function ($entry) use (&$values, $propertyFetchMethod) {
174
-                $values[] = $entry->{$propertyFetchMethod}();
173
+            function($entry) use (&$values, $propertyFetchMethod) {
174
+                $values[ ] = $entry->{$propertyFetchMethod}();
175 175
             }
176 176
         );
177 177
 
Please login to merge, or discard this patch.
src/Barenote/Factory/NoteFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@
 block discarded – undo
16 16
     public static function fromArray(array $data)
17 17
     {
18 18
         return (new Note())
19
-            ->setId(new NoteId($data['id']))
20
-            ->setCategoryId(new CategoryId($data['category_id']))
21
-            ->setUserId(new UserId($data['user_id']))
22
-            ->setContent($data['content'])
23
-            ->setTitle($data['title']);
19
+            ->setId(new NoteId($data[ 'id' ]))
20
+            ->setCategoryId(new CategoryId($data[ 'category_id' ]))
21
+            ->setUserId(new UserId($data[ 'user_id' ]))
22
+            ->setContent($data[ 'content' ])
23
+            ->setTitle($data[ 'title' ]);
24 24
     }
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/Barenote/BarenoteClient.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      * @var Transport
16 16
      */
17 17
     private $transport;
18
-    private $endpoints = [];
18
+    private $endpoints = [ ];
19 19
 
20 20
     /**
21 21
      * BarenoteClient constructor.
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
         $this->transport = new HttpfulTransport();
27 27
         $this->transport->setHost($host);
28 28
 
29
-        $this->endpoints['authentication'] = new Authentication($this->transport);
30
-        $this->endpoints['notes'] = new Notes($this->transport);
29
+        $this->endpoints[ 'authentication' ] = new Authentication($this->transport);
30
+        $this->endpoints[ 'notes' ] = new Notes($this->transport);
31 31
     }
32 32
   
33 33
     public function authenticate(string $username, string $password): Token
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     private function getAuthenticationEndpoint()
46 46
     {
47
-        return $this->endpoints['authentication'];
47
+        return $this->endpoints[ 'authentication' ];
48 48
     }
49 49
 
50 50
     /**
@@ -52,6 +52,6 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function getNotesEndpoint()
54 54
     {
55
-        return $this->endpoints['notes'];
55
+        return $this->endpoints[ 'notes' ];
56 56
     }
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
src/Barenote/Endpoint/Notes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
         $this->notes->clear();
56 56
         foreach ($notes->body->notes as $note) {
57
-            $this->notes->add(NoteFactory::fromArray((array)$note));
57
+            $this->notes->add(NoteFactory::fromArray((array) $note));
58 58
         }
59 59
         $this->notes->update();
60 60
     }
Please login to merge, or discard this patch.