Completed
Push — master ( 3fd935...2823b4 )
by Maxence
16:51
created
src/Maxpou/BeerBundle/Entity/Brewery.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     /**
79 79
      * Get id
80 80
      *
81
-     * @return UUID
81
+     * @return integer
82 82
      */
83 83
     public function getId()
84 84
     {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     /**
158 158
      * Get beers
159 159
      *
160
-     * @return \Doctrine\Common\Collections\Collection
160
+     * @return Beer
161 161
      */
162 162
     public function getBeers()
163 163
     {
Please login to merge, or discard this patch.
src/ApiBundle/Tests/Controller/BreweryApiControllerTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
     {
15 15
         $client = static::createClient();
16 16
         $em = $client->getContainer()
17
-                     ->get('doctrine')
18
-                     ->getManager();
17
+                        ->get('doctrine')
18
+                        ->getManager();
19 19
 
20 20
         $loader = new Loader();
21 21
         $loader->addFixture(new LoadBeersData());
Please login to merge, or discard this patch.
src/ApiBundle/Controller/BreweryController.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $breweries = $em  ->getRepository('MaxpouBeerBundle:Brewery')
44 44
                           ->findBy([], ['name' => 'ASC'], $limit, $offset);
45 45
 
46
-        $context = SerializationContext::create()->setGroups(array('Default','list'));
46
+        $context = SerializationContext::create()->setGroups(array('Default', 'list'));
47 47
         $view = $this->view($breweries, 200);
48 48
         $view->setSerializationContext($context);
49 49
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             throw new HttpException(404, 'Unable to find this Brewery entity');
74 74
         }
75 75
 
76
-        $context = SerializationContext::create()->setGroups(array('Default','details'));
76
+        $context = SerializationContext::create()->setGroups(array('Default', 'details'));
77 77
         $view = $this->view($brewery, 200);
78 78
         $view->setSerializationContext($context);
79 79
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $em->flush();
109 109
 
110 110
             $view = $this->view($brewery, 201);
111
-            $context = SerializationContext::create()->setGroups(array('Default','details'));
111
+            $context = SerializationContext::create()->setGroups(array('Default', 'details'));
112 112
             $view->setSerializationContext($context);
113 113
         } else {
114 114
             $view = $this->view($form, 400);
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
         $em        = $this->getDoctrine()->getManager();
43 43
         $breweries = $em  ->getRepository('MaxpouBeerBundle:Brewery')
44
-                          ->findBy([], ['name' => 'ASC'], $limit, $offset);
44
+                            ->findBy([], ['name' => 'ASC'], $limit, $offset);
45 45
 
46 46
         $context = SerializationContext::create()->setGroups(array('Default','list'));
47 47
         $view = $this->view($breweries, 200);
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
     }
52 52
 
53 53
     /**
54
-      * Get a Brewery entity
55
-      * @ApiDoc(
56
-      *  statusCodes={
57
-      *      200="Returned when successful",
58
-      *      400="Returned when parameter is wrong",
59
-      *      404="Returned when not found"
60
-      * })
61
-      * @param UUID $breweryId Brewery Id
62
-      */
54
+     * Get a Brewery entity
55
+     * @ApiDoc(
56
+     *  statusCodes={
57
+     *      200="Returned when successful",
58
+     *      400="Returned when parameter is wrong",
59
+     *      404="Returned when not found"
60
+     * })
61
+     * @param UUID $breweryId Brewery Id
62
+     */
63 63
     public function getAction($breweryId)
64 64
     {
65 65
     //   * @Route(requirements={
@@ -82,20 +82,20 @@  discard block
 block discarded – undo
82 82
     }
83 83
 
84 84
     /**
85
-      * Add a Brewery
86
-      *
87
-      * @ApiDoc(
88
-      *  statusCodes={
89
-      *      201="Returned when successful",
90
-      *      400="Returned when parameter is wrong"
91
-      *  },
92
-      *  input = {
93
-      *      "class" = "Maxpou\BeerBundle\Form\Type\BreweryType",
94
-      *      "groups"={"list"},
95
-      *      "name" = ""
96
-      *  },
97
-      * )
98
-      */
85
+     * Add a Brewery
86
+     *
87
+     * @ApiDoc(
88
+     *  statusCodes={
89
+     *      201="Returned when successful",
90
+     *      400="Returned when parameter is wrong"
91
+     *  },
92
+     *  input = {
93
+     *      "class" = "Maxpou\BeerBundle\Form\Type\BreweryType",
94
+     *      "groups"={"list"},
95
+     *      "name" = ""
96
+     *  },
97
+     * )
98
+     */
99 99
     public function postAction(Request $request)
100 100
     {
101 101
         $brewery = new Brewery();
Please login to merge, or discard this patch.
src/ApiBundle/Tests/Controller/BeerApiControllerTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
     {
15 15
         $client = static::createClient();
16 16
         $em = $client->getContainer()
17
-                     ->get('doctrine')
18
-                     ->getManager();
17
+                        ->get('doctrine')
18
+                        ->getManager();
19 19
 
20 20
         $loader = new Loader();
21 21
         $loader->addFixture(new LoadBeersData());
Please login to merge, or discard this patch.
src/Maxpou/BeerBundle/Tests/Controller/BeerControllerTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
     {
15 15
         $client = static::createClient();
16 16
         $em = $client->getContainer()
17
-                     ->get('doctrine')
18
-                     ->getManager();
17
+                        ->get('doctrine')
18
+                        ->getManager();
19 19
 
20 20
         $loader = new Loader();
21 21
         $loader->addFixture(new LoadBeersData());
Please login to merge, or discard this patch.
src/ApiBundle/Controller/BeerController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use FOS\RestBundle\Request\ParamFetcher;
9 9
 use Maxpou\BeerBundle\Entity\Beer;
10 10
 use Maxpou\BeerBundle\Form\Type\BeerApiType;
11
-use Maxpou\BeerBundle\Form\Type\BeerType;
12 11
 use Nelmio\ApiDocBundle\Annotation\ApiDoc;
13 12
 use Symfony\Component\HttpFoundation\Request;
14 13
 use Symfony\Component\HttpFoundation\Response;
Please login to merge, or discard this patch.
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -40,25 +40,25 @@  discard block
 block discarded – undo
40 40
 
41 41
         $em    = $this->getDoctrine()->getManager();
42 42
         $beers = $em ->getRepository('MaxpouBeerBundle:Beer')
43
-                     ->findBy(
44
-                         ['brewery' => $breweryId],
45
-                         ['name' => 'ASC'], $limit, $offset
46
-                     );
43
+                        ->findBy(
44
+                            ['brewery' => $breweryId],
45
+                            ['name' => 'ASC'], $limit, $offset
46
+                        );
47 47
 
48 48
         return $beers;
49 49
     }
50 50
 
51 51
     /**
52
-      * Get a Beer entity
53
-      *
54
-      * @ApiDoc(
55
-      *  statusCodes={
56
-      *      200="Returned when successful",
57
-      *      404="Returned when not found"
58
-      * })
59
-      * @param UUID $breweryId Brewery Id
60
-      * @param UUID $beerId    Beer Id
61
-      */
52
+     * Get a Beer entity
53
+     *
54
+     * @ApiDoc(
55
+     *  statusCodes={
56
+     *      200="Returned when successful",
57
+     *      404="Returned when not found"
58
+     * })
59
+     * @param UUID $breweryId Brewery Id
60
+     * @param UUID $beerId    Beer Id
61
+     */
62 62
     public function getAction($breweryId, $beerId)
63 63
     {
64 64
         $brewery = $this->getDoctrine()->getManager()
@@ -81,19 +81,19 @@  discard block
 block discarded – undo
81 81
     }
82 82
 
83 83
     /**
84
-      * Add a Beer
85
-      *
86
-      * @ApiDoc(
87
-      *  statusCodes={
88
-      *       201="Returned when successful",
89
-      *       400="Returned when parameter is wrong"
90
-      *  },
91
-      *  input = {
92
-      *      "class" = "Maxpou\BeerBundle\Form\Type\BeerApiType",
93
-      *      "name"  = ""
94
-      * })
95
-      * @param UUID $breweryId Brewery Id
96
-      */
84
+     * Add a Beer
85
+     *
86
+     * @ApiDoc(
87
+     *  statusCodes={
88
+     *       201="Returned when successful",
89
+     *       400="Returned when parameter is wrong"
90
+     *  },
91
+     *  input = {
92
+     *      "class" = "Maxpou\BeerBundle\Form\Type\BeerApiType",
93
+     *      "name"  = ""
94
+     * })
95
+     * @param UUID $breweryId Brewery Id
96
+     */
97 97
     public function postAction($breweryId, Request $request)
98 98
     {
99 99
         $brewery = $this->getDoctrine()->getManager()
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
     public function putAction($breweryId, Request $request, $beerId)
143 143
     {
144 144
         $beer = $this->getDoctrine()->getManager()
145
-                     ->getRepository('MaxpouBeerBundle:Beer')
146
-                     ->find($beerId);
145
+                        ->getRepository('MaxpouBeerBundle:Beer')
146
+                        ->find($beerId);
147 147
 
148 148
         if (!$beer) {
149 149
             throw new HttpException(404, 'Unable to find this Beer entity');
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
     public function deleteAction($breweryId, $beerId)
182 182
     {
183 183
         $beer = $this->getDoctrine()->getManager()
184
-                     ->getRepository('MaxpouBeerBundle:Beer')
185
-                     ->find($beerId);
184
+                        ->getRepository('MaxpouBeerBundle:Beer')
185
+                        ->find($beerId);
186 186
 
187 187
         if ($beer) {
188 188
             $em = $this->getDoctrine()->getManager();
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     {
207 207
         $em = $this->getDoctrine()->getManager();
208 208
         $brewery = $em->getRepository('MaxpouBeerBundle:Brewery')
209
-                      ->find($breweryId);
209
+                        ->find($breweryId);
210 210
 
211 211
         if (!$brewery) {
212 212
             throw new HttpException(404, 'Unable to find this Brewery entity');
Please login to merge, or discard this patch.