Passed
Branch scrutinizer (7e64c3)
by Nikita
06:59 queued 02:33
created
Command/GenerateEntityCommand.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -75,6 +75,9 @@
 block discarded – undo
75 75
         }
76 76
     }
77 77
 
78
+    /**
79
+     * @param boolean $displayStatus
80
+     */
78 81
     protected function getMetadata(InputInterface $input, OutputInterface $output, $displayStatus) {
79 82
         $manager = new DisconnectedMetadataFactory($this->getContainer()->get('doctrine'));
80 83
         try {
Please login to merge, or discard this patch.
Generator/RestControllerGenerator.php 3 patches
Doc Comments   +17 added lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@  discard block
 block discarded – undo
18 18
      */
19 19
     protected $entityBundle;
20 20
 
21
+    /**
22
+     * @param string $name
23
+     */
21 24
     public function setEntityName($name) {
22 25
         $this->entityName = $name;
23 26
     }
@@ -25,18 +28,32 @@  discard block
 block discarded – undo
25 28
         $this->entityBundle = $bundle;
26 29
     }
27 30
 
31
+    /**
32
+     * @param boolean $flag
33
+     */
28 34
     public function setUseTrait($flag) {
29 35
         $this->trait = $flag;
30 36
     }
31 37
 
38
+    /**
39
+     * @param string $file
40
+     */
32 41
     public function setTemplateFile($file) {
33 42
         $this->template = $file;
34 43
     }
35 44
 
45
+    /**
46
+     * @param boolean $mongo
47
+     */
36 48
     public function setMongo($mongo) {
37 49
         $this->mongo = $mongo;
38 50
     }
39 51
 
52
+    /**
53
+     * @param string $controller
54
+     * @param string $routeFormat
55
+     * @param string $templateFormat
56
+     */
40 57
     public function generate(BundleInterface $bundle, $controller, $routeFormat, $templateFormat, array $actions = array())
41 58
     {
42 59
         $dir = $bundle->getPath();
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Tpg\ExtjsBundle\Generator;
3 3
 
4
-use Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver;
5 4
 use Sensio\Bundle\GeneratorBundle\Generator\ControllerGenerator;
6 5
 use Symfony\Component\HttpKernel\Bundle\BundleInterface;
7 6
 use Symfony\Component\Yaml\Yaml;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,11 +64,11 @@
 block discarded – undo
64 64
             'trait'      => $this->trait,
65 65
             'namespace'  => $bundle->getNamespace(),
66 66
             'bundle'     => $bundle->getName(),
67
-            "manager"    => ($this->mongo===true)?"doctrine_mongodb.odm.default_document_manager":"doctrine.orm.default_entity_manager",
68
-            'serializer' => ($this->mongo===true)?"tpg_extjs.odm_serializer":"tpg_extjs.orm_serializer",
67
+            "manager"    => ($this->mongo === true) ? "doctrine_mongodb.odm.default_document_manager" : "doctrine.orm.default_entity_manager",
68
+            'serializer' => ($this->mongo === true) ? "tpg_extjs.odm_serializer" : "tpg_extjs.orm_serializer",
69 69
             'controller'        => $controller,
70 70
             'entity_class'      => $entityClass,
71
-            'entity_name'       => str_replace(array("/","\\"), "_", $this->entityName),
71
+            'entity_name'       => str_replace(array("/", "\\"), "_", $this->entityName),
72 72
             'entity_bundle'     => $this->entityBundle->getName(),
73 73
             'entity'            => array_pop($tmpEntity),
74 74
             'route_name_prefix' => strtolower(preg_replace('/([A-Z])/', '_\\1', $bundle->getName().'_api_'))
Please login to merge, or discard this patch.
Service/GeneratorService.php 4 patches
Doc Comments   +13 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,10 +27,16 @@  discard block
 block discarded – undo
27 27
     protected $remotingBundles = array();
28 28
     protected $fieldsParams = array();
29 29
 
30
+    /**
31
+     * @param AnnotationReader $reader
32
+     */
30 33
     public function setAnnotationReader($reader) {
31 34
         $this->annoReader = $reader;
32 35
     }
33 36
 
37
+    /**
38
+     * @param \Test\TestBundle\Mockup\TwigEngineMokcup $engine
39
+     */
34 40
     public function setTwigEngine($engine) {
35 41
         $this->twig = $engine;
36 42
     }
@@ -127,6 +133,9 @@  discard block
 block discarded – undo
127 133
         }
128 134
     }
129 135
 
136
+    /**
137
+     * @param string $name
138
+     */
130 139
     protected function convertNaming($name) {
131 140
         return $name;
132 141
     }
@@ -351,9 +360,9 @@  discard block
 block discarded – undo
351 360
 
352 361
     /**
353 362
      * Get Annotation
354
-     * @param $entity
355
-     * @param $property
356
-     * @param $annotation
363
+     * @param string $entity
364
+     * @param string $property
365
+     * @param string $annotation
357 366
      * @return Annotation|null
358 367
      */
359 368
     protected function getAnnotation($entity, $property, $annotation) {
@@ -367,7 +376,7 @@  discard block
 block discarded – undo
367 376
      * Get Column Type of a model.
368 377
      *
369 378
      * @param $entity string Class name of the entity
370
-     * @param $property string
379
+     * @param string $property string
371 380
      * @return string
372 381
      */
373 382
     public function getEntityColumnType($entity, $property) {
Please login to merge, or discard this patch.
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.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function generateRemotingApi() {
49 49
         $list = array();
50
-        foreach($this->remotingBundles as $bundle) {
50
+        foreach ($this->remotingBundles as $bundle) {
51 51
             $controllers = array();
52 52
             $bundleRef = new \ReflectionClass($bundle);
53 53
             $controllerDir = new Finder();
54 54
             $controllerDir->files()->in(dirname($bundleRef->getFileName()).'/Controller/')->name('/.*Controller\.php$/');
55
-            foreach($controllerDir as $controllerFile) {
56
-                $controller = $bundleRef->getNamespaceName() . "\\Controller\\" . substr($controllerFile->getFilename(), 0, -4);
55
+            foreach ($controllerDir as $controllerFile) {
56
+                $controller = $bundleRef->getNamespaceName()."\\Controller\\".substr($controllerFile->getFilename(), 0, -4);
57 57
                 $controllerRef = new \ReflectionClass($controller);
58 58
                 foreach ($controllerRef->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
59 59
                     /** @var $methodDirectAnnotation Direct */
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 $modelName = str_replace("\\", ".", $classRef->getName());
86 86
             }
87 87
             if ($classModelAnnotation->generateAsBase === true) {
88
-                $modelName = substr($modelName, 0, strrpos($modelName, '.')+1) . 'Base' . substr($modelName, strrpos($modelName, '.')+1);
88
+                $modelName = substr($modelName, 0, strrpos($modelName, '.') + 1).'Base'.substr($modelName, strrpos($modelName, '.') + 1);
89 89
             }
90 90
             $structure = array(
91 91
                 'name' => $modelName,
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
             if (strpos(get_class($annotation), 'Symfony\Component\Validator\Constraints') === 0) {
155 155
                 $validators[] = array_merge(
156 156
                     array('field'=>$this->convertNaming($property->getName())),
157
-                    $this->getValidator(substr($className, 40),$annotation)
157
+                    $this->getValidator(substr($className, 40), $annotation)
158 158
                 );
159 159
             }
160
-            switch(get_class($annotation)) {
160
+            switch (get_class($annotation)) {
161 161
                 case 'Tpg\ExtjsBundle\Annotation\Model\Field':
162 162
                     $field['type'] = $annotation->type;
163 163
                     break;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                             $format = explode(',',
211 211
                                 substr(
212 212
                                     $type,
213
-                                    stripos($type, '<')+2,
213
+                                    stripos($type, '<') + 2,
214 214
                                     -2
215 215
                                 )
216 216
                             );
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
                     $field['type'] = $this->getEntityColumnType($association['entity'], $annotation->referencedColumnName);
275 275
                     $field['useNull'] = true;
276 276
                     $association['key'] = $this->convertNaming($annotation->name);
277
-                    $field['mapping'] = $property->getName() . '.' . $annotation->referencedColumnName;
277
+                    $field['mapping'] = $property->getName().'.'.$annotation->referencedColumnName;
278 278
                     break;
279 279
             }
280 280
         }
281
-        if($fieldIsId){
281
+        if ($fieldIsId) {
282 282
             $structure['idProperty'] = $field['name'];
283 283
         }
284 284
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      * @throws \Exception
311 311
      * @return string
312 312
      */
313
-    protected function tryToGetJoinColumnNameOfMappedBy($annotation){
313
+    protected function tryToGetJoinColumnNameOfMappedBy($annotation) {
314 314
         $annotation = $this->tryToGetJoinColumnAnnotationOfMappedBy($annotation);
315 315
         if ($annotation !== null) {
316 316
             if ($annotation instanceof JoinColumn) {
@@ -330,9 +330,9 @@  discard block
 block discarded – undo
330 330
      * @param OneToMany $annotation
331 331
      * @return null|Annotation
332 332
      */
333
-    protected function tryToGetJoinColumnAnnotationOfMappedBy($annotation){
333
+    protected function tryToGetJoinColumnAnnotationOfMappedBy($annotation) {
334 334
         $result = null;
335
-        if($annotation->targetEntity && $annotation->mappedBy) {
335
+        if ($annotation->targetEntity && $annotation->mappedBy) {
336 336
             $result = $this->getAnnotation(
337 337
                 $annotation->targetEntity,
338 338
                 $annotation->mappedBy,
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
      */
459 459
     protected function getValidator($name, $annotation) {
460 460
         $validate = array();
461
-        switch($name) {
461
+        switch ($name) {
462 462
             case 'NotBlank':
463 463
             case 'NotNull':
464 464
                 $validate['type'] = "presence";
@@ -468,8 +468,8 @@  discard block
 block discarded – undo
468 468
                 break;
469 469
             case 'Length':
470 470
                 $validate['type'] = "length";
471
-                $validate['max'] = (int)$annotation->max;
472
-                $validate['min'] = (int)$annotation->min;
471
+                $validate['max'] = (int) $annotation->max;
472
+                $validate['min'] = (int) $annotation->min;
473 473
                 break;
474 474
             case 'Regex':
475 475
                 if ($annotation->match) {
@@ -482,9 +482,9 @@  discard block
 block discarded – undo
482 482
             case 'MinLength':
483 483
                 $validate['type'] = "length";
484 484
                 if ($name == "MaxLength") {
485
-                    $validate['max'] = (int)$annotation->limit;
485
+                    $validate['max'] = (int) $annotation->limit;
486 486
                 } else {
487
-                    $validate['min'] = (int)$annotation->limit;
487
+                    $validate['min'] = (int) $annotation->limit;
488 488
                 }
489 489
                 break;
490 490
             case 'Choice':
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
                 }
529 529
             }
530 530
         }
531
-        foreach(array_reverse($duplicateList) as $index) {
531
+        foreach (array_reverse($duplicateList) as $index) {
532 532
             unset($list[$index]);
533 533
         }
534 534
     }
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.
Tests/Command/BaseTestGeneratedRestController.php 2 patches
Unused Use Statements   -7 removed lines patch added patch discarded remove patch
@@ -3,16 +3,9 @@
 block discarded – undo
3 3
 
4 4
 include_once(__DIR__ . '/../app/AppKernel.php');
5 5
 
6
-use Doctrine\Bundle\MongoDBBundle\Command\CreateSchemaDoctrineODMCommand;
7
-use Doctrine\Bundle\MongoDBBundle\Command\DropSchemaDoctrineODMCommand;
8 6
 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
9
-use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand;
10
-use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand;
11
-use Doctrine\Bundle\DoctrineBundle\Command\Proxy\CreateSchemaDoctrineCommand;
12
-
13 7
 use Symfony\Bundle\FrameworkBundle\Console\Application;
14 8
 use Symfony\Component\Console\Tester\CommandTester;
15
-use Symfony\Component\Routing\Router;
16 9
 use Tpg\ExtjsBundle\Command\GenerateRestControllerCommand;
17 10
 
18 11
 class BaseTestGeneratedRestController extends WebTestCase {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Tpg\ExtjsBundle\Tests\Command;
3 3
 
4
-include_once(__DIR__ . '/../app/AppKernel.php');
4
+include_once(__DIR__.'/../app/AppKernel.php');
5 5
 
6 6
 use Doctrine\Bundle\MongoDBBundle\Command\CreateSchemaDoctrineODMCommand;
7 7
 use Doctrine\Bundle\MongoDBBundle\Command\DropSchemaDoctrineODMCommand;
Please login to merge, or discard this patch.
Tests/Fixtures/Test/TestBundle/Document/Client.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     /**
96 96
      * Add orders
97 97
      *
98
-     * @param Test\TestBundle\Document\Order $orders
98
+     * @param Order $orders
99 99
      *
100 100
      * @return $this
101 101
      */
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     /**
110 110
      * Remove orders
111 111
      *
112
-     * @param Test\TestBundle\Document\Order $orders
112
+     * @param Order $orders
113 113
      */
114 114
     public function removeOrder(\Test\TestBundle\Document\Order $orders)
115 115
     {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * Get orders
122 122
      *
123
-     * @return Doctrine\Common\Collections\Collection $orders
123
+     * @return \Doctrine\Common\Collections\ArrayCollection $orders
124 124
      */
125 125
     public function getOrders()
126 126
     {
Please login to merge, or discard this patch.
Twig/ExtjsExtension.php 1 patch
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,6 @@
 block discarded – undo
48 48
     /**
49 49
      * Inject ExtJs Model into the DOM.
50 50
      *
51
-     * @param boolean $injection Produce ExtJS model code on the page directly?
52
-     * @param string $model Model Name.
53 51
      */
54 52
     public function injectModel() {
55 53
         $params = func_get_args();
Please login to merge, or discard this patch.
Controller/GeneratorController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,26 +20,26 @@  discard block
 block discarded – undo
20 20
         $kernel = $this->get('kernel');
21 21
         if ($models === null) {
22 22
             $list = $this->container->getParameter("tpg_extjs.entities");
23
-            return new StreamedResponse(function () use($list, $generator, $kernel) {
23
+            return new StreamedResponse(function() use($list, $generator, $kernel) {
24 24
                 foreach ($list as $configEntityLine) {
25 25
                     list($bundleName, $path) = explode("/", substr($configEntityLine, 1), 2);
26 26
                     /** @var Bundle $bundle */
27 27
                     $bundle = $kernel->getBundle($bundleName, true);
28 28
 
29 29
                     /** Entity end with backslash, it is a directory */
30
-                    $loadAllEntitiesFromDir = ($configEntityLine[strlen($configEntityLine)-1] == "/");
30
+                    $loadAllEntitiesFromDir = ($configEntityLine[strlen($configEntityLine) - 1] == "/");
31 31
 
32
-                    if ( $loadAllEntitiesFromDir ) {
32
+                    if ($loadAllEntitiesFromDir) {
33 33
                         $bundleRef = new \ReflectionClass($bundle);
34 34
                         $dir = new Finder();
35 35
                         $dir->files()->depth('== 0')->in(dirname($bundleRef->getFileName()).'/'.$path)->name('/.*\.php$/');
36
-                        foreach($dir as $file) {
36
+                        foreach ($dir as $file) {
37 37
                             /** @var SplFileInfo $file*/
38
-                            $entityClassname = $bundleRef->getNamespaceName() . "\\" . str_replace("/", "\\", $path) . substr($file->getFilename(), 0, -4);
38
+                            $entityClassname = $bundleRef->getNamespaceName()."\\".str_replace("/", "\\", $path).substr($file->getFilename(), 0, -4);
39 39
                             echo $generator->generateMarkupForEntity($entityClassname);
40 40
                         }
41
-                    } else  {
42
-                        $entityClassname = $bundle->getNamespace() . "\\" . str_replace("/", "\\", $path);
41
+                    } else {
42
+                        $entityClassname = $bundle->getNamespace()."\\".str_replace("/", "\\", $path);
43 43
                         echo $generator->generateMarkupForEntity($entityClassname);
44 44
                     }
45 45
                 }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             if (!is_array($models)) {
52 52
                 $models = array($models);
53 53
             }
54
-            return new StreamedResponse(function () use($models, $generator) {
54
+            return new StreamedResponse(function() use($models, $generator) {
55 55
                 foreach ($models as $model) {
56 56
                     $model = str_replace(".", "\\", $model);
57 57
                     echo $generator->generateMarkupForEntity($model);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         } else {
103 103
             $requestData = array();
104 104
             $i = 0;
105
-            foreach($actionparams as $parameter) {
105
+            foreach ($actionparams as $parameter) {
106 106
                 $requestData[$parameter->getName()] = $data[$i++];
107 107
             }
108 108
         }
Please login to merge, or discard this patch.
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 2 patches
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 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
 
Please login to merge, or discard this patch.