Completed
Push — master ( bdc56b...2eeb2e )
by Julien
06:25
created
Tests/Units/Mapping.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
      * getMappingArray
203 203
      *
204 204
      * @access private
205
-     * @return void
205
+     * @return ClassMetadata[]
206 206
      */
207 207
     private function getMappingArray()
208 208
     {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
             ->given($this->newTestedInstance)
25 25
                 ->and($this->testedInstance->setMapping([new ClassMetadata('foo', null, null)]))
26 26
             ->then($testedInstance = $this->testedInstance)
27
-            ->exception(function () use ($testedInstance) {
27
+            ->exception(function() use ($testedInstance) {
28 28
                 @$testedInstance->getModelName();
29 29
             })
30 30
                 ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException')
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             ->given($this->newTestedInstance)
35 35
                 ->and($this->testedInstance->setMapping([new ClassMetadata('foo', null, null)]))
36 36
             ->then($testedInstance = $this->testedInstance)
37
-            ->exception(function () use ($testedInstance) {
37
+            ->exception(function() use ($testedInstance) {
38 38
                 $testedInstance->getModelName('orders');
39 39
             })
40 40
                 ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException')
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             ->given($this->newTestedInstance)
45 45
             ->and($this->testedInstance->setMapping([new ClassMetadata('orders', null, null)]))
46 46
             ->then($testedInstance = $this->testedInstance)
47
-            ->exception(function () use ($testedInstance) {
47
+            ->exception(function() use ($testedInstance) {
48 48
                 $testedInstance->getModelName('orders');
49 49
             })
50 50
                 ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException')
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             // no mappings
93 93
             ->given($this->newTestedInstance)
94 94
             ->then($testedInstance = $this->testedInstance)
95
-                ->exception(function () use ($testedInstance) {
95
+                ->exception(function() use ($testedInstance) {
96 96
                     $testedInstance->getKeyFromId('/orders/8');
97 97
                 })
98 98
                 ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException')
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     ->isEqualTo('order_items')
142 142
 
143 143
             ->then($testedInstance = $this->testedInstance)
144
-            ->exception(function () use ($testedInstance) {
144
+            ->exception(function() use ($testedInstance) {
145 145
                 $testedInstance->getKeyFromModel('\Not\Viable\Classname');
146 146
             })
147 147
                 ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException')
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                     ->isInstanceOf('Mapado\RestClientSdk\Mapping\ClassMetadata')
168 168
 
169 169
             ->then
170
-            ->exception(function () use ($testedInstance) {
170
+            ->exception(function() use ($testedInstance) {
171 171
                 $testedInstance->getClassMetadata('Foo\Bar');
172 172
             })
173 173
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException')
@@ -224,6 +224,6 @@  discard block
 block discarded – undo
224 224
             'Foo\Bar\Client\ClientClient'
225 225
         );
226 226
 
227
-        return [ $order, $orderItem, $client, ];
227
+        return [$order, $orderItem, $client, ];
228 228
     }
229 229
 }
Please login to merge, or discard this patch.
Tests/Model/Cart.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@
 block discarded – undo
154 154
 
155 155
     public function addCartItemList($cartItem)
156 156
     {
157
-        $this->cartItemList[] =  $cartItem;
157
+        $this->cartItemList[] = $cartItem;
158 158
     }
159 159
 
160 160
     /**
Please login to merge, or discard this patch.
Tests/Units/RestClient.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             ->then
72 72
                 ->object($this->testedInstance->get('/not-json'))
73 73
                     ->isInstanceOf('\GuzzleHttp\Psr7\Response')
74
-           ;
74
+            ;
75 75
     }
76 76
 
77 77
     /**
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException')
111 111
                     ->hasMessage('Error while deleting resource')
112 112
                     ->hasCode(2)
113
-           ;
113
+            ;
114 114
     }
115 115
 
116 116
     /**
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                     ->isNull()
61 61
 
62 62
             ->then($testedInstance = $this->testedInstance)
63
-                ->exception(function () use ($testedInstance) {
63
+                ->exception(function() use ($testedInstance) {
64 64
                     $testedInstance->get('/error');
65 65
                 })
66 66
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException')
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                     ->isNull()
105 105
 
106 106
             ->then($testedInstance = $this->testedInstance)
107
-                ->exception(function () use ($testedInstance) {
107
+                ->exception(function() use ($testedInstance) {
108 108
                     $testedInstance->delete('/error');
109 109
                 })
110 110
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException')
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                     ->string($data['activityUuid'])
150 150
                         ->isEqualTo('63d108be-629c-11e5-b5ce-f153631dac50')
151 151
             ->then($testedInstance = $this->testedInstance)
152
-                ->exception(function () use ($testedInstance, $params) {
152
+                ->exception(function() use ($testedInstance, $params) {
153 153
                     $testedInstance->post('/not-found', $params);
154 154
                 })
155 155
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\RestClientException')
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                     ->hasCode(3)
158 158
 
159 159
             ->then
160
-                ->exception(function () use ($testedInstance, $params) {
160
+                ->exception(function() use ($testedInstance, $params) {
161 161
                     $testedInstance->post('/error', $params);
162 162
                 })
163 163
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException')
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                     ->string($data['activityUuid'])
203 203
                         ->isEqualTo('a9e82f60-629e-11e5-8903-0d978bd11e5d')
204 204
             ->then($testedInstance = $this->testedInstance)
205
-                ->exception(function () use ($testedInstance, $params) {
205
+                ->exception(function() use ($testedInstance, $params) {
206 206
                     $testedInstance->put('/not-found', $params);
207 207
                 })
208 208
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\RestClientException')
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                     ->hasCode(5)
211 211
 
212 212
             ->then
213
-                ->exception(function () use ($testedInstance, $params) {
213
+                ->exception(function() use ($testedInstance, $params) {
214 214
                     $testedInstance->put('/error', $params);
215 215
                 })
216 216
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException')
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
             ->if($testedInstance = $this->testedInstance)
277 277
             ->and
278
-                ->exception(function () use ($testedInstance) {
278
+                ->exception(function() use ($testedInstance) {
279 279
                     $testedInstance->get('/');
280 280
                 })
281 281
             ->then
@@ -290,13 +290,13 @@  discard block
 block discarded – undo
290 290
             [
291 291
                 new Response(
292 292
                     200,
293
-                    [ 'Content-Type' => 'application/ld+json' ],
293
+                    ['Content-Type' => 'application/ld+json'],
294 294
                     file_get_contents(__DIR__ . '/../data/ticketing.list.no_result.json')
295 295
                 ),
296 296
 
297 297
                 new Response(
298 298
                     200,
299
-                    [ 'Content-Type' => 'application/ld+json' ],
299
+                    ['Content-Type' => 'application/ld+json'],
300 300
                     file_get_contents(__DIR__ . '/../data/ticketing.list.no_result.json')
301 301
                 ),
302 302
             ]
Please login to merge, or discard this patch.
Tests/Units/SdkClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
                 ->object($testedInstance->getRepository('orders'))
61 61
                     ->isInstanceOf('Mapado\RestClientSdk\Tests\Model\ModelRepository')
62 62
 
63
-                ->exception(function () use ($testedInstance) {
63
+                ->exception(function() use ($testedInstance) {
64 64
                     $testedInstance->getRepository('foo');
65 65
                 })
66 66
                     ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException')
Please login to merge, or discard this patch.
src/Mapping/Driver/AnnotationDriver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         foreach ($iterator as $file) {
78 78
             $sourceFile = $file[0];
79
-            if (! preg_match('(^phar:)i', $sourceFile)) {
79
+            if (!preg_match('(^phar:)i', $sourceFile)) {
80 80
                 $sourceFile = realpath($sourceFile);
81 81
             }
82 82
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $metadata = $this->getClassMetadataForClassname($classname);
116 116
 
117
-        return $metadata ? [$metadata,] : [];
117
+        return $metadata ? [$metadata, ] : [];
118 118
     }
119 119
 
120 120
     /**
Please login to merge, or discard this patch.
src/Mapping.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
     public function getMappingKeys()
77 77
     {
78 78
         return array_map(
79
-            function ($mapping) {
79
+            function($mapping) {
80 80
                 return $mapping->getKey();
81 81
             },
82 82
             $this->mapping
Please login to merge, or discard this patch.
src/Model/ModelHydrator.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
     public function deserializeAll($data, $modelName)
96 96
     {
97 97
         $data['hydra:member'] = array_map(
98
-            function ($member) use ($modelName) {
98
+            function($member) use ($modelName) {
99 99
                 return $this->deserialize($member, $modelName);
100 100
             },
101 101
             $data['hydra:member']
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@
 block discarded – undo
33 33
     }
34 34
 
35 35
     /**
36
-      * convertId
37
-      *
38
-      * @param string $id
39
-      * @param string $modelName
40
-      * @access public
41
-      * @return string
42
-      */
36
+     * convertId
37
+     *
38
+     * @param string $id
39
+     * @param string $modelName
40
+     * @access public
41
+     * @return string
42
+     */
43 43
     public function convertId($id, $modelName)
44 44
     {
45 45
         $id = (string) $id;
Please login to merge, or discard this patch.
src/EntityRepository.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 namespace Mapado\RestClientSdk;
3 3
 
4 4
 use Mapado\RestClientSdk\Exception\SdkException;
5
-use Symfony\Component\Cache\CacheItem;
6 5
 
7 6
 class EntityRepository
8 7
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@
 block discarded – undo
262 262
         $mapping = $this->sdk->getMapping();
263 263
 
264 264
         return array_map(
265
-            function ($item) use ($mapping) {
265
+            function($item) use ($mapping) {
266 266
                 if (is_object($item)) {
267 267
                     $classname = get_class($item);
268 268
 
Please login to merge, or discard this patch.
Tests/Units/EntityRepository.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,6 @@
 block discarded – undo
125 125
     /**
126 126
      * testFindWithCache
127 127
      *
128
-     * @param mixed $method
129 128
      * @access public
130 129
      * @return void
131 130
      */
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         $this->calling($this->mockedRestClient)->get = [];
115 115
 
116 116
         $this
117
-            ->if($this->repository->find('1', [ 'foo' => 'bar', 'bar'  => 'baz' ]))
117
+            ->if($this->repository->find('1', ['foo' => 'bar', 'bar'  => 'baz']))
118 118
             ->then
119 119
                 ->mock($this->mockedRestClient)
120 120
                     ->call('get')
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
             ->given($this->resetMock($this->mockedRestClient))
178 178
                 ->and($this->mockedSdk->getCacheItemPool()->clear())
179 179
 
180
-            ->if($this->repository->findBy([ 'foo' => 'bar', 'bar'  => 'baz' ]))
181
-            ->and($this->repository->findBy([ 'foo' => 'bar', 'bar'  => 'baz' ]))
180
+            ->if($this->repository->findBy(['foo' => 'bar', 'bar'  => 'baz']))
181
+            ->and($this->repository->findBy(['foo' => 'bar', 'bar'  => 'baz']))
182 182
             ->if($this->repository->find(1))
183 183
             ->then
184 184
                 ->mock($this->mockedRestClient)
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
             // find one by
204 204
             ->given($this->resetMock($this->mockedRestClient))
205 205
 
206
-            ->if($this->repository->findOneBy([ 'foo' => 'baz', 'bar'  => 'bar' ]))
207
-            ->and($this->repository->findOneBy([ 'foo' => 'baz', 'bar'  => 'bar' ]))
206
+            ->if($this->repository->findOneBy(['foo' => 'baz', 'bar'  => 'bar']))
207
+            ->and($this->repository->findOneBy(['foo' => 'baz', 'bar'  => 'bar']))
208 208
             ->then
209 209
                 ->mock($this->mockedRestClient)
210 210
                     ->call('get')
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
             // find one by with data already in cache
224 224
             ->given($this->resetMock($this->mockedRestClient))
225
-            ->if($this->repository->findOneBy([ 'foo' => 'bar', 'bar'  => 'baz' ]))
225
+            ->if($this->repository->findOneBy(['foo' => 'bar', 'bar'  => 'baz']))
226 226
             ->then
227 227
                 ->mock($this->mockedRestClient)
228 228
                     ->call('get')
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -340,10 +340,10 @@  discard block
 block discarded – undo
340 340
         $this
341 341
             ->if($repository->findBy(['section' => $section1]))
342 342
             // ->then(ldd(iterator_to_array($arrayAdapter->getItems())))
343
-           ->then
344
-               ->mock($this->mockedRestClient)
345
-                   ->call('get')
346
-                       ->withArguments('/sections?section=%2Fsections%2F1')->once()
343
+            ->then
344
+                ->mock($this->mockedRestClient)
345
+                    ->call('get')
346
+                        ->withArguments('/sections?section=%2Fsections%2F1')->once()
347 347
 
348 348
             ->if($repository->findAll())
349 349
             // ->then(ldd(iterator_to_array($arrayAdapter->getItems())))
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
                 ->boolean($arrayAdapter->hasItem('test_prefix__sections_1'))
352 352
                     ->isTrue()
353 353
 
354
-           ->if($repository->find(1))
355
-           ->then
356
-               ->mock($this->mockedRestClient)
357
-                   ->call('get')
358
-                       ->withArguments('/sections/1')->never()
354
+            ->if($repository->find(1))
355
+            ->then
356
+                ->mock($this->mockedRestClient)
357
+                    ->call('get')
358
+                        ->withArguments('/sections/1')->never()
359 359
 
360 360
             // after update
361 361
             ->if($repository->update($section1))
Please login to merge, or discard this patch.