Completed
Pull Request — master (#82)
by
unknown
07:46
created
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 1 patch
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.
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/Uploader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
             'file' => $file,
66 66
         ));
67 67
 
68
-        switch ((int)$response->getResult()->entity) {
68
+        switch ((int) $response->getResult()->entity) {
69 69
             case 0:
70 70
                 $matches = array();
71 71
                 preg_match('/\/records\/(\d+)\/(\d+)\//', $response->getResult()->url, $matches);
Please login to merge, or discard this patch.
src/PhraseanetSDK/Search/SearchResultInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
      */
130 130
     public function getFacets()
131 131
     {
132
-        if (! isset($this->source->facets)) {
132
+        if (!isset($this->source->facets)) {
133 133
             $this->facets = new ArrayCollection();
134 134
         }
135 135
 
Please login to merge, or discard this patch.
src/PhraseanetSDK/OAuth2Connector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
         try {
97 97
             $responseContent = $this->adapter->call(
98 98
                 'POST',
99
-                $this->getUrl() . static::TOKEN_ENDPOINT,
99
+                $this->getUrl().static::TOKEN_ENDPOINT,
100 100
                 array(),
101 101
                 $postFields
102 102
             );
Please login to merge, or discard this patch.
src/PhraseanetSDK/Monitor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,8 +112,8 @@
 block discarded – undo
112 112
     {
113 113
         $entity = new static::$mappings[$name]['entity']();
114 114
 
115
-        array_walk($data, function ($value, $property) use ($entity) {
116
-            $method = 'set'.implode('', array_map(function ($chunk) {
115
+        array_walk($data, function($value, $property) use ($entity) {
116
+            $method = 'set'.implode('', array_map(function($chunk) {
117 117
                     return ucfirst($chunk);
118 118
             }, preg_split('/[-_]/', $property)));
119 119
 
Please login to merge, or discard this patch.
src/PhraseanetSDK/Orders/OrderRepository.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@  discard block
 block discarded – undo
21 21
     {
22 22
         // 't' param is used for cache busting
23 23
         $parameters = [
24
-            'includes' => [ 'elements' ],
24
+            'includes' => ['elements'],
25 25
             't' => time()
26 26
         ];
27 27
 
28
-        $response = $this->query('GET', 'v2/orders/' . $orderId, $parameters);
28
+        $response = $this->query('GET', 'v2/orders/'.$orderId, $parameters);
29 29
 
30 30
         if ($response->isEmpty()) {
31 31
             throw new RuntimeException('Response content is empty');
32 32
         }
33 33
 
34
-        if (! $response->hasProperty('data')) {
34
+        if (!$response->hasProperty('data')) {
35 35
             throw new RuntimeException('Missing \'data\' property in response');
36 36
         }
37 37
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $parameters = [
45 45
             'page' => max($pageIndex, 0),
46 46
             'per_page' => max($pageSize, 1),
47
-            'includes' => [ 'elements' ],
47
+            'includes' => ['elements'],
48 48
             't' => time()
49 49
         ];
50 50
 
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
             throw new RuntimeException('Response content is empty');
55 55
         }
56 56
 
57
-        if (! $response->hasProperty('data')) {
57
+        if (!$response->hasProperty('data')) {
58 58
             throw new RuntimeException('Missing \'data\' property in response');
59 59
         }
60 60
 
61
-        if (! $response->hasProperty('meta')) {
61
+        if (!$response->hasProperty('meta')) {
62 62
             throw new RuntimeException('Missing \'meta\' property in response');
63 63
         }
64 64
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             'records' => $recordsIds
75 75
         ];
76 76
 
77
-        $response = $this->query('POST', 'v2/orders/', [], [ 'data' => $parameters ], [
77
+        $response = $this->query('POST', 'v2/orders/', [], ['data' => $parameters], [
78 78
             'Accept' => 'application/json',
79 79
             'Content-Type' => 'application/json'
80 80
         ]);
Please login to merge, or discard this patch.
src/PhraseanetSDK/Repository/User.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function requestPasswordReset(string $emailAddress): string
95 95
     {
96
-        $response = $this->query('POST', 'v1/accounts/reset-password/' . urlencode($emailAddress) . '/');
96
+        $response = $this->query('POST', 'v1/accounts/reset-password/'.urlencode($emailAddress).'/');
97 97
 
98 98
         if (!$response->hasProperty('reset_token')) {
99 99
             throw new RuntimeException('Missing "token" property in response content');
100 100
         }
101 101
 
102
-        return (string)$response->getProperty('reset_token');
102
+        return (string) $response->getProperty('reset_token');
103 103
     }
104 104
 
105 105
     /**
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function resetPassword(string $token, string $password): bool
115 115
     {
116
-        $response = $this->query('POST', 'v1/accounts/update-password/' . $token . '/', array(), array(
116
+        $response = $this->query('POST', 'v1/accounts/update-password/'.$token.'/', array(), array(
117 117
             'password' => $password
118 118
         ));
119 119
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             throw new RuntimeException('Missing "success" property in response content');
122 122
         }
123 123
 
124
-        return (bool)$response->getProperty('success');
124
+        return (bool) $response->getProperty('success');
125 125
     }
126 126
 
127 127
     /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             throw new RuntimeException('Missing "success" property in response content');
147 147
         }
148 148
 
149
-        return (bool)$response->getProperty('success');
149
+        return (bool) $response->getProperty('success');
150 150
     }
151 151
 
152 152
     /**
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             throw new RuntimeException('Missing "token" property in response content');
194 194
         }
195 195
 
196
-        return (string)$response->getProperty('token');
196
+        return (string) $response->getProperty('token');
197 197
     }
198 198
 
199 199
     public function updateUser(UserEntity $user)
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             throw new RuntimeException('Missing "success" property in response content');
223 223
         }
224 224
 
225
-        return (bool)$response->getProperty('success');
225
+        return (bool) $response->getProperty('success');
226 226
     }
227 227
 
228 228
     /**
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
      */
245 245
     public function unlockAccount(string $token): bool
246 246
     {
247
-        $response = $this->query('POST', 'v1/accounts/unlock/' . $token . '/');
247
+        $response = $this->query('POST', 'v1/accounts/unlock/'.$token.'/');
248 248
 
249 249
         if (!$response->hasProperty('success')) {
250 250
             throw new \RuntimeException('Missing "success" property in response content');
251 251
         }
252 252
 
253
-        return (bool)$response->getProperty('success');
253
+        return (bool) $response->getProperty('success');
254 254
     }
255 255
 }
Please login to merge, or discard this patch.