Passed
Branch scrutinizer (7e64c3)
by Nikita
06:59 queued 02:33
created
TpgExtjsBundle.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,18 +17,22 @@
 block discarded – undo
17 17
 
18 18
         $builder->addCompilerPass(new LazyServiceMapPass('tpg_extjs.serialization_visitor', 'format',
19 19
             function(ContainerBuilder $container, Definition $def) {
20
-                if ($container->hasDefinition("tpg_extjs.orm_serializer"))
21
-                    $container->getDefinition('tpg_extjs.orm_serializer')->replaceArgument(3, $def);
22
-                if ($container->hasDefinition("tpg_extjs.odm_serializer"))
23
-                    $container->getDefinition('tpg_extjs.odm_serializer')->replaceArgument(3, $def);
20
+                if ($container->hasDefinition("tpg_extjs.orm_serializer")) {
21
+                                    $container->getDefinition('tpg_extjs.orm_serializer')->replaceArgument(3, $def);
22
+                }
23
+                if ($container->hasDefinition("tpg_extjs.odm_serializer")) {
24
+                                    $container->getDefinition('tpg_extjs.odm_serializer')->replaceArgument(3, $def);
25
+                }
24 26
             }
25 27
         ));
26 28
         $builder->addCompilerPass(new LazyServiceMapPass('tpg_extjs.deserialization_visitor', 'format',
27 29
             function(ContainerBuilder $container, Definition $def) {
28
-                if ($container->hasDefinition("tpg_extjs.orm_serializer"))
29
-                    $container->getDefinition('tpg_extjs.orm_serializer')->replaceArgument(4, $def);
30
-                if ($container->hasDefinition("tpg_extjs.odm_serializer"))
31
-                    $container->getDefinition('tpg_extjs.odm_serializer')->replaceArgument(4, $def);
30
+                if ($container->hasDefinition("tpg_extjs.orm_serializer")) {
31
+                                    $container->getDefinition('tpg_extjs.orm_serializer')->replaceArgument(4, $def);
32
+                }
33
+                if ($container->hasDefinition("tpg_extjs.odm_serializer")) {
34
+                                    $container->getDefinition('tpg_extjs.odm_serializer')->replaceArgument(4, $def);
35
+                }
32 36
             }
33 37
         ));
34 38
 
Please login to merge, or discard this patch.
Tests/Service/GeneratorServiceTest.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,19 +21,19 @@
 block discarded – undo
21 21
         $this->twigEngine = new TwigEngineMokcup();
22 22
         $this->service->setTwigEngine($this->twigEngine);
23 23
         $this->service->setModelFieldsParameters(array(
24
-          "date" => array( "format" => "d-m-y")
24
+            "date" => array( "format" => "d-m-y")
25 25
         ));
26 26
     }
27 27
 
28 28
     public function testCustomFieldParameters() {
29
-      $this->service->generateMarkupForEntity('Test\TestBundle\Model\Person');
30
-      $fieldsType = array();
31
-      foreach ($this->twigEngine->renderParameters['fields'] as $field) {
29
+        $this->service->generateMarkupForEntity('Test\TestBundle\Model\Person');
30
+        $fieldsType = array();
31
+        foreach ($this->twigEngine->renderParameters['fields'] as $field) {
32 32
         if (isset($field['format'])) {
33
-          $fieldsType[$field['name']] = $field['format'];
33
+            $fieldsType[$field['name']] = $field['format'];
34
+        }
34 35
         }
35
-      }
36
-      $this->assertEquals("d-m-y", $fieldsType['createdAt']);
36
+        $this->assertEquals("d-m-y", $fieldsType['createdAt']);
37 37
     }
38 38
 
39 39
     public function testEntityProperty() {
Please login to merge, or discard this patch.
Service/GeneratorService.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                     break;
261 261
                 case 'Doctrine\ORM\Mapping\JoinColumns':
262 262
                     if (count($annotation->value) > 1) {
263
-                      throw new \Exception('Multiple foreign key is not supported');
263
+                        throw new \Exception('Multiple foreign key is not supported');
264 264
                     }
265 265
                     $saveField = true;
266 266
                     $field['name'] = $this->convertNaming($annotation->value[0]->name);
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
         /** Add the ability to override field parameter */
286 286
         if (isset($this->fieldsParams[$field['type']])) {
287
-          $field = array_merge($field, $this->fieldsParams[$field['type']]);
287
+            $field = array_merge($field, $this->fieldsParams[$field['type']]);
288 288
         }
289 289
 
290 290
         if (!empty($association)) {
Please login to merge, or discard this patch.
Braces   +20 added lines, -8 removed lines patch added patch discarded remove patch
@@ -99,8 +99,12 @@  discard block
 block discarded – undo
99 99
                 $structure['proxy'] = array(
100 100
                     'type'=>$classModelProxyAnnotation->name,
101 101
                 ) + $classModelProxyAnnotation->option;
102
-                if ($classModelProxyAnnotation->reader != array()) $structure['proxy']['reader'] = $classModelProxyAnnotation->reader;
103
-                if ($classModelProxyAnnotation->writer != array()) $structure['proxy']['writer'] = $classModelProxyAnnotation->writer;
102
+                if ($classModelProxyAnnotation->reader != array()) {
103
+                    $structure['proxy']['reader'] = $classModelProxyAnnotation->reader;
104
+                }
105
+                if ($classModelProxyAnnotation->writer != array()) {
106
+                    $structure['proxy']['writer'] = $classModelProxyAnnotation->writer;
107
+                }
104 108
             }
105 109
             /** @var $classExclusionPolicy ExclusionPolicy */
106 110
             $classExclusionPolicy = $this->annoReader->getClassAnnotation($classRef, 'JMS\Serializer\Annotation\ExclusionPolicy');
@@ -223,8 +227,9 @@  discard block
 block discarded – undo
223 227
                     $association['name'] = $property->getName();
224 228
                     $association['model'] = $this->getModelName($annotation->targetEntity);
225 229
                     $association['entity'] = $annotation->targetEntity;
226
-                    if (!isset($association['key']) || empty($association['key']))
227
-                        $association['key'] = $this->tryToGetJoinColumnNameOfMappedBy($annotation);
230
+                    if (!isset($association['key']) || empty($association['key'])) {
231
+                                            $association['key'] = $this->tryToGetJoinColumnNameOfMappedBy($annotation);
232
+                    }
228 233
                     break;
229 234
                 case 'Doctrine\ORM\Mapping\OneToMany':
230 235
                     $association['type'] = substr(get_class($annotation), 21);
@@ -359,8 +364,11 @@  discard block
 block discarded – undo
359 364
     protected function getAnnotation($entity, $property, $annotation) {
360 365
         $classRef = new \ReflectionClass($entity);
361 366
         $propertyRef = $classRef->getProperty($property);
362
-        if ($propertyRef) return $this->annoReader->getPropertyAnnotation($propertyRef, $annotation);
363
-        else return null;
367
+        if ($propertyRef) {
368
+            return $this->annoReader->getPropertyAnnotation($propertyRef, $annotation);
369
+        } else {
370
+            return null;
371
+        }
364 372
     }
365 373
 
366 374
     /**
@@ -520,9 +528,13 @@  discard block
 block discarded – undo
520 528
         $secondList = $list;
521 529
         $duplicateList = array();
522 530
         foreach ($list as $index=>$row) {
523
-            if (in_array($index, $duplicateList)) continue;
531
+            if (in_array($index, $duplicateList)) {
532
+                continue;
533
+            }
524 534
             foreach ($secondList as $index2 => $row2) {
525
-                if ($index === $index2) continue;
535
+                if ($index === $index2) {
536
+                    continue;
537
+                }
526 538
                 if ($row == $row2) {
527 539
                     $duplicateList[] = $index2;
528 540
                 }
Please login to merge, or discard this patch.
Listener/DeserializationAssociateRelationship.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@
 block discarded – undo
27 27
         $classMetadata = $e->getContext()->getMetadataFactory()->getMetadataForClass($className);
28 28
         /** @var PropertyMetadata $propertyMetadata */
29 29
         foreach ($classMetadata->propertyMetadata as $propertyMetadata) {
30
-            if ($propertyMetadata->reflection === null) continue;
30
+            if ($propertyMetadata->reflection === null) {
31
+                continue;
32
+            }
31 33
             /** @var JoinColumn $joinColumnAnnotation */
32 34
             $joinColumnAnnotation = $this->reader->getPropertyAnnotation(
33 35
                 $propertyMetadata->reflection,
Please login to merge, or discard this patch.