Completed
Pull Request — master (#78)
by Thibaud
09:34
created
src/PhraseanetSDK/Entity/Story.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,6 @@
 block discarded – undo
12 12
 namespace PhraseanetSDK\Entity;
13 13
 
14 14
 use Doctrine\Common\Collections\ArrayCollection;
15
-use PhraseanetSDK\Annotation\ApiField as ApiField;
16
-use PhraseanetSDK\Annotation\ApiRelation as ApiRelation;
17 15
 use PhraseanetSDK\EntityManager;
18 16
 
19 17
 class Story
Please login to merge, or discard this patch.
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      */
139 139
     public function getThumbnail()
140 140
     {
141
-        if (! isset($this->source->thumbnail)) {
141
+        if (!isset($this->source->thumbnail)) {
142 142
             return null;
143 143
         }
144 144
 
@@ -191,8 +191,7 @@  discard block
 block discarded – undo
191 191
     public function getRecordCount()
192 192
     {
193 193
         return $this->recordCount !== null ?
194
-            $this->recordCount :
195
-            $this->recordCount =
194
+            $this->recordCount : $this->recordCount =
196 195
                 (isset($this->source->record_count) ? $this->source->record_count : count($this->getRecords()));
197 196
     }
198 197
 
@@ -201,7 +200,7 @@  discard block
 block discarded – undo
201 200
      */
202 201
     public function getRecords()
203 202
     {
204
-        if (! isset($this->source->records)) {
203
+        if (!isset($this->source->records)) {
205 204
             $this->records = new ArrayCollection();
206 205
         }
207 206
 
@@ -215,7 +214,7 @@  discard block
 block discarded – undo
215 214
      */
216 215
     public function getMetadata()
217 216
     {
218
-        if (! isset($this->source->metadata)) {
217
+        if (!isset($this->source->metadata)) {
219 218
             $this->metadata = new ArrayCollection();
220 219
         }
221 220
 
@@ -229,7 +228,7 @@  discard block
 block discarded – undo
229 228
      */
230 229
     public function getStatus()
231 230
     {
232
-        if (! isset($this->status)) {
231
+        if (!isset($this->status)) {
233 232
             $this->status = $this->entityManager->getRepository('recordStatus')->findByRecord(
234 233
                 $this->getDataboxId(),
235 234
                 $this->getStoryId()
@@ -244,11 +243,11 @@  discard block
 block discarded – undo
244 243
      */
245 244
     public function getCaption()
246 245
     {
247
-        if (! isset($this->caption) && isset($this->source->caption)) {
246
+        if (!isset($this->caption) && isset($this->source->caption)) {
248 247
             $this->caption = RecordCaption::fromList((array) $this->source->caption);
249 248
         }
250 249
 
251
-        if (! isset($this->caption)) {
250
+        if (!isset($this->caption)) {
252 251
             $this->caption = $this->entityManager->getRepository('caption')->findByRecord(
253 252
                 $this->getDataboxId(),
254 253
                 $this->getStoryId()
Please login to merge, or discard this patch.
src/PhraseanetSDK/Repository/User.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 
12 12
 namespace PhraseanetSDK\Repository;
13 13
 
14
-use PhraseanetSDK\EntityHydrator;
15 14
 use PhraseanetSDK\Exception\RuntimeException;
16 15
 
17 16
 class User extends AbstractRepository
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function requestPasswordReset($emailAddress)
78 78
     {
79
-        $response = $this->query('POST', 'v1/accounts/reset-password/' . $emailAddress . '/');
79
+        $response = $this->query('POST', 'v1/accounts/reset-password/'.$emailAddress.'/');
80 80
 
81 81
         if (!$response->hasProperty('reset_token')) {
82 82
             throw new RuntimeException('Missing "token" property in response content');
83 83
         }
84 84
 
85
-        return (string)$response->getProperty('reset_token');
85
+        return (string) $response->getProperty('reset_token');
86 86
     }
87 87
 
88 88
     /**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function resetPassword($token, $password)
96 96
     {
97
-        $response = $this->query('POST', 'v1/accounts/update-password/' . $token . '/', array(), array(
97
+        $response = $this->query('POST', 'v1/accounts/update-password/'.$token.'/', array(), array(
98 98
             'password' => $password
99 99
         ));
100 100
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             throw new RuntimeException('Missing "success" property in response content');
103 103
         }
104 104
 
105
-        return (bool)$response->getProperty('success');
105
+        return (bool) $response->getProperty('success');
106 106
     }
107 107
 
108 108
     public function updatePassword($currentPassword, $newPassword)
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             throw new RuntimeException('Missing "success" property in response content');
120 120
         }
121 121
 
122
-        return (bool)$response->getProperty('success');
122
+        return (bool) $response->getProperty('success');
123 123
     }
124 124
 
125 125
     /**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             throw new \RuntimeException('Missing "token" property in response content');
166 166
         }
167 167
 
168
-        return (string)$response->getProperty('token');
168
+        return (string) $response->getProperty('token');
169 169
     }
170 170
 
171 171
     public function updateUser(\PhraseanetSDK\Entity\User $user)
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             throw new RuntimeException('Missing "success" property in response content');
195 195
         }
196 196
 
197
-        return (bool)$response->getProperty('success');
197
+        return (bool) $response->getProperty('success');
198 198
     }
199 199
 
200 200
     public function deleteAccount()
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
      */
211 211
     public function unlockAccount($token)
212 212
     {
213
-        $response = $this->query('POST', 'v1/accounts/unlock/' . $token . '/', array(), array());
213
+        $response = $this->query('POST', 'v1/accounts/unlock/'.$token.'/', array(), array());
214 214
 
215 215
         if (!$response->hasProperty('success')) {
216 216
             throw new \RuntimeException('Missing "success" property in response content');
217 217
         }
218 218
 
219
-        return (bool)$response->getProperty('success');
219
+        return (bool) $response->getProperty('success');
220 220
     }
221 221
 }
Please login to merge, or discard this patch.
src/PhraseanetSDK/Entity/Basket.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
      */
167 167
     public function getValidationUsers()
168 168
     {
169
-        if (! $this->isValidationBasket()) {
169
+        if (!$this->isValidationBasket()) {
170 170
             return null;
171 171
         }
172 172
 
Please login to merge, or discard this patch.
src/PhraseanetSDK/Entity/BasketElement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
      */
111 111
     public function getValidationChoices()
112 112
     {
113
-        if (! isset($this->source->validation_choices)) {
113
+        if (!isset($this->source->validation_choices)) {
114 114
             $this->validationChoices = new ArrayCollection();
115 115
         }
116 116
 
Please login to merge, or discard this patch.
src/PhraseanetSDK/Entity/FeedEntry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
      */
147 147
     public function getItems()
148 148
     {
149
-        if (! isset($this->source->items)) {
149
+        if (!isset($this->source->items)) {
150 150
             $this->items = new ArrayCollection();
151 151
         }
152 152
 
Please login to merge, or discard this patch.
src/PhraseanetSDK/Entity/Query.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     public function getSuggestions()
154 154
     {
155
-        if (! isset($this->source->suggestions)) {
155
+        if (!isset($this->source->suggestions)) {
156 156
             $this->suggestions = new ArrayCollection();
157 157
         }
158 158
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     public function getFacets()
168 168
     {
169
-        if (! isset($this->source->facets)) {
169
+        if (!isset($this->source->facets)) {
170 170
             $this->facets = new ArrayCollection();
171 171
         }
172 172
 
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,6 @@
 block discarded – undo
12 12
 namespace PhraseanetSDK\Entity;
13 13
 
14 14
 use Doctrine\Common\Collections\ArrayCollection;
15
-use PhraseanetSDK\Annotation\ApiField as ApiField;
16
-use PhraseanetSDK\Annotation\ApiRelation as ApiRelation;
17 15
 use PhraseanetSDK\EntityManager;
18 16
 
19 17
 class Story
Please login to merge, or discard this patch.
src/PhraseanetSDK/Entity/QueryFacet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
      */
64 64
     public function getValues()
65 65
     {
66
-        if (! isset($this->source->values)) {
66
+        if (!isset($this->source->values)) {
67 67
             $this->values = new ArrayCollection();
68 68
         }
69 69
 
Please login to merge, or discard this patch.
src/PhraseanetSDK/Http/APIResponse.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
     public function getStatusCode()
56 56
     {
57
-        return (int)$this->meta->http_code;
57
+        return (int) $this->meta->http_code;
58 58
     }
59 59
 
60 60
     /**
Please login to merge, or discard this patch.
src/PhraseanetSDK/Http/GuzzleAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
      */
76 76
     public function setExtended($extended)
77 77
     {
78
-        $this->extended = (boolean)$extended;
78
+        $this->extended = (boolean) $extended;
79 79
     }
80 80
 
81 81
     /**
Please login to merge, or discard this patch.