Test Setup Failed
Branch master (6a703f)
by Nikita
08:04
created
Tests/Command/ORM/GeneratedRestControllerAssociationTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $manager = $this->client->getContainer()->get("doctrine.orm.default_entity_manager");
24 24
         $owner = new CarOwner();
25 25
         $owner->setName("james");
26
-        foreach($this->records as $record) {
26
+        foreach ($this->records as $record) {
27 27
             $owner->addCar($record);
28 28
         }
29 29
         $manager->persist($owner);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     public function testGetWithAssociation() {
46 46
         $filter = json_encode(array(
47
-            array('property'=>'name','value'=>'Ford')
47
+            array('property'=>'name', 'value'=>'Ford')
48 48
         ));
49 49
         $this->client->request('GET', '/cars.json?filter='.$filter);
50 50
         $content = json_decode($this->client->getResponse()->getContent(), true);
Please login to merge, or discard this patch.
Tests/Command/ORM/GenerateRestControllerCommandTest.php 1 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\ORM;
3 3
 
4
-include_once(__DIR__ . '/../../app/AppKernel.php');
4
+include_once(__DIR__.'/../../app/AppKernel.php');
5 5
 
6 6
 use Symfony\Bundle\FrameworkBundle\Console\Application;
7 7
 use Symfony\Component\Console\Tester\CommandTester;
Please login to merge, or discard this patch.
Tests/Command/ODM/GeneratedRestControllerReferenceAssociationTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 class GeneratedRestControllerReferenceAssociationTest extends BaseTestGeneratedRestController {
8 8
     public function testGetWithAssociation() {
9 9
         $filter = json_encode(array(
10
-            array('property'=>'name','value'=>'Invoice 1')
10
+            array('property'=>'name', 'value'=>'Invoice 1')
11 11
         ));
12 12
         $this->client->request('GET', '/orders.json?filter='.$filter);
13 13
         $content = json_decode($this->client->getResponse()->getContent(), true);
Please login to merge, or discard this patch.
Tests/Command/ODM/GenerateRestControllerCommandTest.php 1 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\ODM;
3 3
 
4
-include_once(__DIR__ . '/../../app/AppKernel.php');
4
+include_once(__DIR__.'/../../app/AppKernel.php');
5 5
 
6 6
 use Symfony\Bundle\FrameworkBundle\Console\Application;
7 7
 use Symfony\Component\Console\Tester\CommandTester;
Please login to merge, or discard this patch.
Tests/Command/ODM/GeneratedRestControllerEmbeddedAssociationTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 
8 8
     public function testGetWithAssociation() {
9 9
         $filter = json_encode(array(
10
-            array('property'=>'name','value'=>'Invoice 1')
10
+            array('property'=>'name', 'value'=>'Invoice 1')
11 11
         ));
12 12
         $this->client->request('GET', '/orders.json?filter='.$filter);
13 13
         $content = json_decode($this->client->getResponse()->getContent(), true);
Please login to merge, or discard this patch.
Tests/app_test.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
     exit(0);
6 6
 }
7 7
 
8
-$loader = require_once __DIR__ . '/bootstrap.php';
9
-require_once __DIR__ . '/app/AppKernel.php';
8
+$loader = require_once __DIR__.'/bootstrap.php';
9
+require_once __DIR__.'/app/AppKernel.php';
10 10
 use Symfony\Component\HttpFoundation\Request;
11 11
 
12 12
 $kernel = new AppKernel('test', true);
Please login to merge, or discard this patch.
Resources/skeleton/controller/UseTraitController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,20 +2,20 @@
 block discarded – undo
2 2
 
3 3
 namespace {{ namespace }}\Controller;
4 4
 
5
-{% block use_statements %}
5
+{%block use_statements%}
6 6
 use FOS\RestBundle\Controller\FOSRestController;
7 7
 use FOS\RestBundle\Controller\Annotations\QueryParam;
8
-{% endblock use_statements %}
8
+{%endblock use_statements%}
9 9
 
10
-{% block class_definition %}
10
+{%block class_definition%}
11 11
 /**
12 12
  * Class {{ controller }}Controller
13 13
  * @package {{ namespace }}\Controller
14 14
  */
15 15
 class {{ controller }}Controller extends FOSRestController
16
-{% endblock class_definition %}
16
+{%endblock class_definition%}
17 17
 {
18
-{% block class_body %}
18
+{%block class_body%}
19 19
     use Generated\{{ controller }}Controller;
20
-{% endblock class_body %}
20
+{%endblock class_body%}
21 21
 }
Please login to merge, or discard this patch.
Resources/skeleton/controller/Controller.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
 
31 31
 class
32 32
 {%- endif %}
33
- {{ controller }}Controller
33
+    {{ controller }}Controller
34 34
 {%- if not trait %}
35
- extends FOSRestController
35
+    extends FOSRestController
36 36
 {%- endif %}
37 37
 {% endblock class_definition %}
38
- {
38
+    {
39 39
 {% block class_body %}
40 40
     /**
41 41
      * Get detail of a {{ entity_name }} record
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 namespace {{ namespace }}\Controller
4
-{%- if trait %}
4
+{%- if trait%}
5 5
 \Generated
6
-{%- endif %}
6
+{%- endif%}
7 7
 ;
8 8
 
9
-{% block use_statements %}
9
+{%block use_statements%}
10 10
 use Doctrine\ORM\EntityManager;
11 11
 use FOS\RestBundle\Controller\FOSRestController;
12 12
 use FOS\RestBundle\Request\ParamFetcherInterface;
@@ -16,27 +16,27 @@  discard block
 block discarded – undo
16 16
 use \Doctrine\DBAL\DBALException;
17 17
 use \JMS\Serializer\DeserializationContext;
18 18
 use {{ entity_class }};
19
-{% endblock use_statements %}
19
+{%endblock use_statements%}
20 20
 
21
-{% block class_definition %}
21
+{%block class_definition%}
22 22
 /**
23 23
  * {%- if trait %} Trait{%- else %} Class{%- endif %} {{ controller }}Controller
24 24
  */
25 25
 
26
-{%- if trait %}
26
+{%- if trait%}
27 27
 
28 28
 trait
29
-{%- else %}
29
+{%- else%}
30 30
 
31 31
 class
32
-{%- endif %}
32
+{%- endif%}
33 33
  {{ controller }}Controller
34
-{%- if not trait %}
34
+{%- if not trait%}
35 35
  extends FOSRestController
36
-{%- endif %}
37
-{% endblock class_definition %}
36
+{%- endif%}
37
+{%endblock class_definition%}
38 38
  {
39
-{% block class_body %}
39
+{%block class_body%}
40 40
     /**
41 41
      * Get detail of a {{ entity_name }} record
42 42
      * @param              $id
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function get{{ controller|capitalize }}Action($id) {
50 50
         $manager = $this->get("{{ manager }}");
51 51
         $entity = $manager->getRepository('{{ entity_bundle }}:{{ entity }}')->find($id);
52
-        $view = View::create($entity, 200)->setSerializationContext($this->getSerializerContext(array("get")));;
52
+        $view = View::create($entity, 200)->setSerializationContext($this->getSerializerContext(array("get"))); ;
53 53
         return $this->handleView($view);
54 54
     }
55 55
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $start = 0;
83 83
         if ($paramFetcher->get("start") === "0") {
84 84
             if ($paramFetcher->get("page") > 1) {
85
-                $start = ($paramFetcher->get("page")-1) * $paramFetcher->get("limit");
85
+                $start = ($paramFetcher->get("page") - 1)*$paramFetcher->get("limit");
86 86
             }
87 87
         } else {
88 88
             $start = $paramFetcher->get("start");
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
             $paramFetcher->get("limit"),
94 94
             $start
95 95
         );
96
-        {%- if mongo %}
96
+        {%- if mongo%}
97 97
 // @todo fix it...
98 98
 //        $list = array_values($list->toArray());
99
-        {%- endif %}
99
+        {%- endif%}
100 100
 
101 101
         $context = $this->getSerializerContext(array('list'));
102 102
         $view = View::create($list, 200)->setSerializationContext($context);
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         return $this->handleView(View::create(null, 204));
241 241
     }
242 242
 
243
-{% endblock class_body %}
243
+{%endblock class_body%}
244 244
 
245 245
     protected function getSerializerContext($groups = array(), $version = null) {
246 246
         $serializeContext = SerializationContext::create();
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,8 @@  discard block
 block discarded – undo
26 26
 {%- if trait %}
27 27
 
28 28
 trait
29
-{%- else %}
29
+{%- else {
30
+    %}
30 31
 
31 32
 class
32 33
 {%- endif %}
@@ -48,6 +49,7 @@  discard block
 block discarded – undo
48 49
      */
49 50
     public function get{{ controller|capitalize }}Action($id) {
50 51
         $manager = $this->get("{{ manager }}");
52
+}
51 53
         $entity = $manager->getRepository('{{ entity_bundle }}:{{ entity }}')->find($id);
52 54
         $view = View::create($entity, 200)->setSerializationContext($this->getSerializerContext(array("get")));;
53 55
         return $this->handleView($view);
@@ -249,7 +251,9 @@  discard block
 block discarded – undo
249 251
             array(\JMS\Serializer\Exclusion\GroupsExclusionStrategy::DEFAULT_GROUP),
250 252
             $groups
251 253
         ));
252
-        if ($version !== null) $serializeContext->setVersion($version);
254
+        if ($version !== null) {
255
+            $serializeContext->setVersion($version);
256
+        }
253 257
         return $serializeContext;
254 258
     }
255 259
 }
Please login to merge, or discard this patch.
Command/GenerateRestControllerCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,25 +101,25 @@
 block discarded – undo
101 101
             }
102 102
         }
103 103
 
104
-        $dialog->writeSection($output, 'Controller generation: ' . $controller . 'Controller (' . $bundle->getName() . ')');
104
+        $dialog->writeSection($output, 'Controller generation: '.$controller.'Controller ('.$bundle->getName().')');
105 105
 
106 106
         /** @var RestControllerGenerator $generator */
107 107
         $generator = $this->getGenerator($bundle);
108 108
         if ($input->getOption('trait')) {
109 109
             $output->writeln("<info>Generating Controller with Traits</info>");
110 110
             $generator->setUseTrait(true);
111
-            $generator->generate($bundle,$controller,'','');
111
+            $generator->generate($bundle, $controller, '', '');
112 112
             $output->writeln("<info>Trait Controller Generated</info>");
113 113
             $generator->setUseTrait(false);
114 114
             $generator->setTemplateFile('UseTraitController.php');
115 115
             try {
116
-                $generator->generate($bundle,$controller,'','');
116
+                $generator->generate($bundle, $controller, '', '');
117 117
                 $output->writeln("<info>Controller Generated</info>");
118 118
             } catch (\RuntimeException $e) {
119 119
                 $output->writeln("<info>Controller Skipped</info>");
120 120
             }
121 121
         } else {
122
-            $generator->generate($bundle,$controller,'','');
122
+            $generator->generate($bundle, $controller, '', '');
123 123
             $output->writeln("<info>Controller Generated</info>");
124 124
         }
125 125
 
Please login to merge, or discard this patch.