Completed
Pull Request — master (#69)
by Laurent
15:31
created
src/AppBundle/Tests/Form/Type/GroupTypeTest.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,8 @@  discard block
 block discarded – undo
21 21
      * Sets up the fixture, for example, opens a network connection.
22 22
      * This method is called before a test is executed.
23 23
      */
24
-    protected function setUp() {
24
+    protected function setUp()
25
+    {
25 26
         $this->object = new GroupType;
26 27
         $kernel = static::createKernel();
27 28
         $kernel->boot();
@@ -33,7 +34,8 @@  discard block
 block discarded – undo
33 34
      * Tears down the fixture, for example, closes a network connection.
34 35
      * This method is called after a test is executed.
35 36
      */
36
-    protected function tearDown() {
37
+    protected function tearDown()
38
+    {
37 39
         
38 40
     }
39 41
 
@@ -41,7 +43,8 @@  discard block
 block discarded – undo
41 43
      * @covers AppBundle\Form\Type\GroupType::buildForm
42 44
      * @todo   Implement testBuildForm().
43 45
      */
44
-    public function testBuildForm() {
46
+    public function testBuildForm()
47
+    {
45 48
         // Remove the following lines when you implement this test.
46 49
         $this->markTestIncomplete(
47 50
             'This test has not been implemented yet.'
@@ -52,7 +55,8 @@  discard block
 block discarded – undo
52 55
      * @covers AppBundle\Form\Type\GroupType::configureOptions
53 56
      * @todo   Implement testConfigureOptions().
54 57
      */
55
-    public function testConfigureOptions() {
58
+    public function testConfigureOptions()
59
+    {
56 60
         // Remove the following lines when you implement this test.
57 61
         $this->markTestIncomplete(
58 62
             'This test has not been implemented yet.'
@@ -63,7 +67,8 @@  discard block
 block discarded – undo
63 67
      * @covers AppBundle\Form\Type\GroupType::getName
64 68
      * @todo   Implement testGetName().
65 69
      */
66
-    public function testGetName() {
70
+    public function testGetName()
71
+    {
67 72
         // Remove the following lines when you implement this test.
68 73
         $this->markTestIncomplete(
69 74
             'This test has not been implemented yet.'
Please login to merge, or discard this patch.
src/AppBundle/Tests/Entity/ArticleTest.php 1 patch
Braces   +58 added lines, -29 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
      * Sets up the fixture, for example, opens a network connection.
20 20
      * This method is called before a test is executed.
21 21
      */
22
-    protected function setUp() {
22
+    protected function setUp()
23
+    {
23 24
         $this->object = new Article;
24 25
     }
25 26
 
@@ -27,7 +28,8 @@  discard block
 block discarded – undo
27 28
      * Tears down the fixture, for example, closes a network connection.
28 29
      * This method is called after a test is executed.
29 30
      */
30
-    protected function tearDown() {
31
+    protected function tearDown()
32
+    {
31 33
         
32 34
     }
33 35
 
@@ -35,7 +37,8 @@  discard block
 block discarded – undo
35 37
      * @covers AppBundle\Entity\Article::getId
36 38
      * @todo   Implement testGetId().
37 39
      */
38
-    public function testGetId() {
40
+    public function testGetId()
41
+    {
39 42
         // Remove the following lines when you implement this test.
40 43
         $this->markTestIncomplete(
41 44
             'This test has not been implemented yet.'
@@ -46,7 +49,8 @@  discard block
 block discarded – undo
46 49
      * @covers AppBundle\Entity\Article::setName
47 50
      * @todo   Implement testSetName().
48 51
      */
49
-    public function testSetName() {
52
+    public function testSetName()
53
+    {
50 54
         // Remove the following lines when you implement this test.
51 55
         $this->markTestIncomplete(
52 56
             'This test has not been implemented yet.'
@@ -57,7 +61,8 @@  discard block
 block discarded – undo
57 61
      * @covers AppBundle\Entity\Article::getName
58 62
      * @todo   Implement testGetName().
59 63
      */
60
-    public function testGetName() {
64
+    public function testGetName()
65
+    {
61 66
         // Remove the following lines when you implement this test.
62 67
         $this->markTestIncomplete(
63 68
             'This test has not been implemented yet.'
@@ -68,7 +73,8 @@  discard block
 block discarded – undo
68 73
      * @covers AppBundle\Entity\Article::setPackaging
69 74
      * @todo   Implement testSetPackaging().
70 75
      */
71
-    public function testSetPackaging() {
76
+    public function testSetPackaging()
77
+    {
72 78
         // Remove the following lines when you implement this test.
73 79
         $this->markTestIncomplete(
74 80
             'This test has not been implemented yet.'
@@ -79,7 +85,8 @@  discard block
 block discarded – undo
79 85
      * @covers AppBundle\Entity\Article::getPackaging
80 86
      * @todo   Implement testGetPackaging().
81 87
      */
82
-    public function testGetPackaging() {
88
+    public function testGetPackaging()
89
+    {
83 90
         // Remove the following lines when you implement this test.
84 91
         $this->markTestIncomplete(
85 92
             'This test has not been implemented yet.'
@@ -90,7 +97,8 @@  discard block
 block discarded – undo
90 97
      * @covers AppBundle\Entity\Article::setPrice
91 98
      * @todo   Implement testSetPrice().
92 99
      */
93
-    public function testSetPrice() {
100
+    public function testSetPrice()
101
+    {
94 102
         // Remove the following lines when you implement this test.
95 103
         $this->markTestIncomplete(
96 104
             'This test has not been implemented yet.'
@@ -101,7 +109,8 @@  discard block
 block discarded – undo
101 109
      * @covers AppBundle\Entity\Article::getPrice
102 110
      * @todo   Implement testGetPrice().
103 111
      */
104
-    public function testGetPrice() {
112
+    public function testGetPrice()
113
+    {
105 114
         // Remove the following lines when you implement this test.
106 115
         $this->markTestIncomplete(
107 116
             'This test has not been implemented yet.'
@@ -112,7 +121,8 @@  discard block
 block discarded – undo
112 121
      * @covers AppBundle\Entity\Article::setQuantity
113 122
      * @todo   Implement testSetQuantity().
114 123
      */
115
-    public function testSetQuantity() {
124
+    public function testSetQuantity()
125
+    {
116 126
         // Remove the following lines when you implement this test.
117 127
         $this->markTestIncomplete(
118 128
             'This test has not been implemented yet.'
@@ -123,7 +133,8 @@  discard block
 block discarded – undo
123 133
      * @covers AppBundle\Entity\Article::getQuantity
124 134
      * @todo   Implement testGetQuantity().
125 135
      */
126
-    public function testGetQuantity() {
136
+    public function testGetQuantity()
137
+    {
127 138
         // Remove the following lines when you implement this test.
128 139
         $this->markTestIncomplete(
129 140
             'This test has not been implemented yet.'
@@ -134,7 +145,8 @@  discard block
 block discarded – undo
134 145
      * @covers AppBundle\Entity\Article::setMinstock
135 146
      * @todo   Implement testSetMinstock().
136 147
      */
137
-    public function testSetMinstock() {
148
+    public function testSetMinstock()
149
+    {
138 150
         // Remove the following lines when you implement this test.
139 151
         $this->markTestIncomplete(
140 152
             'This test has not been implemented yet.'
@@ -145,7 +157,8 @@  discard block
 block discarded – undo
145 157
      * @covers AppBundle\Entity\Article::getMinstock
146 158
      * @todo   Implement testGetMinstock().
147 159
      */
148
-    public function testGetMinstock() {
160
+    public function testGetMinstock()
161
+    {
149 162
         // Remove the following lines when you implement this test.
150 163
         $this->markTestIncomplete(
151 164
             'This test has not been implemented yet.'
@@ -156,7 +169,8 @@  discard block
 block discarded – undo
156 169
      * @covers AppBundle\Entity\Article::setSupplier
157 170
      * @todo   Implement testSetSupplier().
158 171
      */
159
-    public function testSetSupplier() {
172
+    public function testSetSupplier()
173
+    {
160 174
         // Remove the following lines when you implement this test.
161 175
         $this->markTestIncomplete(
162 176
             'This test has not been implemented yet.'
@@ -167,7 +181,8 @@  discard block
 block discarded – undo
167 181
      * @covers AppBundle\Entity\Article::getSupplier
168 182
      * @todo   Implement testGetSupplier().
169 183
      */
170
-    public function testGetSupplier() {
184
+    public function testGetSupplier()
185
+    {
171 186
         // Remove the following lines when you implement this test.
172 187
         $this->markTestIncomplete(
173 188
             'This test has not been implemented yet.'
@@ -178,7 +193,8 @@  discard block
 block discarded – undo
178 193
      * @covers AppBundle\Entity\Article::setUnitStorage
179 194
      * @todo   Implement testSetUnitStorage().
180 195
      */
181
-    public function testSetUnitStorage() {
196
+    public function testSetUnitStorage()
197
+    {
182 198
         // Remove the following lines when you implement this test.
183 199
         $this->markTestIncomplete(
184 200
             'This test has not been implemented yet.'
@@ -189,7 +205,8 @@  discard block
 block discarded – undo
189 205
      * @covers AppBundle\Entity\Article::getUnitStorage
190 206
      * @todo   Implement testGetUnitStorage().
191 207
      */
192
-    public function testGetUnitStorage() {
208
+    public function testGetUnitStorage()
209
+    {
193 210
         // Remove the following lines when you implement this test.
194 211
         $this->markTestIncomplete(
195 212
             'This test has not been implemented yet.'
@@ -200,7 +217,8 @@  discard block
 block discarded – undo
200 217
      * @covers AppBundle\Entity\Article::addZoneStorage
201 218
      * @todo   Implement testAddZoneStorage().
202 219
      */
203
-    public function testAddZoneStorage() {
220
+    public function testAddZoneStorage()
221
+    {
204 222
         // Remove the following lines when you implement this test.
205 223
         $this->markTestIncomplete(
206 224
             'This test has not been implemented yet.'
@@ -211,7 +229,8 @@  discard block
 block discarded – undo
211 229
      * @covers AppBundle\Entity\Article::removeZoneStorage
212 230
      * @todo   Implement testRemoveZoneStorage().
213 231
      */
214
-    public function testRemoveZoneStorage() {
232
+    public function testRemoveZoneStorage()
233
+    {
215 234
         // Remove the following lines when you implement this test.
216 235
         $this->markTestIncomplete(
217 236
             'This test has not been implemented yet.'
@@ -222,7 +241,8 @@  discard block
 block discarded – undo
222 241
      * @covers AppBundle\Entity\Article::getZoneStorages
223 242
      * @todo   Implement testGetZoneStorages().
224 243
      */
225
-    public function testGetZoneStorages() {
244
+    public function testGetZoneStorages()
245
+    {
226 246
         // Remove the following lines when you implement this test.
227 247
         $this->markTestIncomplete(
228 248
             'This test has not been implemented yet.'
@@ -233,7 +253,8 @@  discard block
 block discarded – undo
233 253
      * @covers AppBundle\Entity\Article::setFamilyLog
234 254
      * @todo   Implement testSetFamilyLog().
235 255
      */
236
-    public function testSetFamilyLog() {
256
+    public function testSetFamilyLog()
257
+    {
237 258
         // Remove the following lines when you implement this test.
238 259
         $this->markTestIncomplete(
239 260
             'This test has not been implemented yet.'
@@ -244,7 +265,8 @@  discard block
 block discarded – undo
244 265
      * @covers AppBundle\Entity\Article::getFamilyLog
245 266
      * @todo   Implement testGetFamilyLog().
246 267
      */
247
-    public function testGetFamilyLog() {
268
+    public function testGetFamilyLog()
269
+    {
248 270
         // Remove the following lines when you implement this test.
249 271
         $this->markTestIncomplete(
250 272
             'This test has not been implemented yet.'
@@ -255,7 +277,8 @@  discard block
 block discarded – undo
255 277
      * @covers AppBundle\Entity\Article::setSubFamilyLog
256 278
      * @todo   Implement testSetSubFamilyLog().
257 279
      */
258
-    public function testSetSubFamilyLog() {
280
+    public function testSetSubFamilyLog()
281
+    {
259 282
         // Remove the following lines when you implement this test.
260 283
         $this->markTestIncomplete(
261 284
             'This test has not been implemented yet.'
@@ -266,7 +289,8 @@  discard block
 block discarded – undo
266 289
      * @covers AppBundle\Entity\Article::getSubFamilyLog
267 290
      * @todo   Implement testGetSubFamilyLog().
268 291
      */
269
-    public function testGetSubFamilyLog() {
292
+    public function testGetSubFamilyLog()
293
+    {
270 294
         // Remove the following lines when you implement this test.
271 295
         $this->markTestIncomplete(
272 296
             'This test has not been implemented yet.'
@@ -277,7 +301,8 @@  discard block
 block discarded – undo
277 301
      * @covers AppBundle\Entity\Article::setActive
278 302
      * @todo   Implement testSetActive().
279 303
      */
280
-    public function testSetActive() {
304
+    public function testSetActive()
305
+    {
281 306
         // Remove the following lines when you implement this test.
282 307
         $this->markTestIncomplete(
283 308
             'This test has not been implemented yet.'
@@ -288,7 +313,8 @@  discard block
 block discarded – undo
288 313
      * @covers AppBundle\Entity\Article::isActive
289 314
      * @todo   Implement testIsActive().
290 315
      */
291
-    public function testIsActive() {
316
+    public function testIsActive()
317
+    {
292 318
         // Remove the following lines when you implement this test.
293 319
         $this->markTestIncomplete(
294 320
             'This test has not been implemented yet.'
@@ -299,7 +325,8 @@  discard block
 block discarded – undo
299 325
      * @covers AppBundle\Entity\Article::setSlug
300 326
      * @todo   Implement testSetSlug().
301 327
      */
302
-    public function testSetSlug() {
328
+    public function testSetSlug()
329
+    {
303 330
         // Remove the following lines when you implement this test.
304 331
         $this->markTestIncomplete(
305 332
             'This test has not been implemented yet.'
@@ -310,7 +337,8 @@  discard block
 block discarded – undo
310 337
      * @covers AppBundle\Entity\Article::getSlug
311 338
      * @todo   Implement testGetSlug().
312 339
      */
313
-    public function testGetSlug() {
340
+    public function testGetSlug()
341
+    {
314 342
         // Remove the following lines when you implement this test.
315 343
         $this->markTestIncomplete(
316 344
             'This test has not been implemented yet.'
@@ -321,7 +349,8 @@  discard block
 block discarded – undo
321 349
      * @covers AppBundle\Entity\Article::__toString
322 350
      * @todo   Implement test__toString().
323 351
      */
324
-    public function test__toString() {
352
+    public function test__toString()
353
+    {
325 354
         // Remove the following lines when you implement this test.
326 355
         $this->markTestIncomplete(
327 356
             'This test has not been implemented yet.'
Please login to merge, or discard this patch.
src/AppBundle/Tests/Controller/DefaultControllerTest.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
         $client = self::createClient(
98 98
             array(),
99 99
             array(
100
-               'HTTP_HOST' => 'symfony2.local',
100
+                'HTTP_HOST' => 'symfony2.local',
101 101
             )
102 102
         );
103 103
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,8 @@
 block discarded – undo
87 87
         );
88 88
     }
89 89
 
90
-    public function testIndex() {
90
+    public function testIndex()
91
+    {
91 92
         $client = self::createClient(
92 93
             array(),
93 94
             array(
Please login to merge, or discard this patch.
src/AppBundle/Controller/AbstractInventoryController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             $typeClass,
49 49
             $inventory,
50 50
             ['action' => $this->generateUrl('inventory_update', ['id' => $inventory->getId()]),
51
-            'method' => 'PUT',]
51
+            'method' => 'PUT', ]
52 52
         );
53 53
         $deleteForm = $this->createDeleteForm($inventory->getId(), 'inventory_delete');
54 54
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             'inventory' => $inventory,
57 57
             'zoneStorages' => $zoneStorages,
58 58
             'edit_form'   => $editForm->createView(),
59
-            'delete_form' => $deleteForm->createView(),];
59
+            'delete_form' => $deleteForm->createView(), ];
60 60
         return $return;
61 61
     }
62 62
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         return $this->createForm(
73 73
             InventoryType::class,
74 74
             $inventory,
75
-            ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'PUT',]
75
+            ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'PUT', ]
76 76
         );
77 77
     }
78 78
     
Please login to merge, or discard this patch.
src/AppBundle/Form/Type/InventoryArticlesType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                     'label' => 'gestock.id',
45 45
                     'translation_domain' => 'messages',
46 46
                     'empty_data' => null,
47
-                    'attr'=> ['class' => 'form-control', 'readonly' => true,],
47
+                    'attr'=> ['class' => 'form-control', 'readonly' => true, ],
48 48
                 )
49 49
             )
50 50
             ->add(
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                     'empty_data' => '0,000',
81 81
                     'label' => 'seizure.realstock',
82 82
                     'translation_domain' => 'gs_inventories',
83
-                    'attr'=> ['class' => 'inventory form-control',]
83
+                    'attr'=> ['class' => 'inventory form-control', ]
84 84
                 )
85 85
             )
86 86
             ->add(
Please login to merge, or discard this patch.
src/AppBundle/Form/Type/InventoryEditZonesType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         parent::buildForm($builder, $options);
38 38
         $builder
39 39
             ->remove('articles')
40
-            ->add('articles', CollectionType::class, ['entry_type' => InventoryArticlesZonesType::class,]);
40
+            ->add('articles', CollectionType::class, ['entry_type' => InventoryArticlesZonesType::class, ]);
41 41
     }
42 42
 
43 43
     /**
Please login to merge, or discard this patch.
src/AppBundle/Controller/ArticleController.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
      *
190 190
      * @param \Symfony\Component\HttpFoundation\Request $request  Form request
191 191
      * @param \AppBundle\Entity\Supplier                $supplier Supplier to desactivate
192
-     * @return array
192
+     * @return \Symfony\Component\HttpFoundation\RedirectResponse
193 193
      */
194 194
     public function changeAction(Request $request, Supplier $supplier)
195 195
     {
Please login to merge, or discard this patch.
src/AppBundle/Controller/OrdersController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@
 block discarded – undo
269 269
      * @Method("GET")
270 270
      * @Template()
271 271
      *
272
-     * @param \AppBundle\Entity\Inventory $orders Inventory item to print
272
+     * @param Orders $orders Inventory item to print
273 273
      * @return \Symfony\Component\HttpFoundation\Response
274 274
      */
275 275
     public function printAction(Orders $orders)
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $em = $this->getDoctrine()->getManager();
47 47
         $item = $this->container->getParameter('knp_paginator.page_range');
48 48
         $qb = $em->getRepository('AppBundle:Orders')->createQueryBuilder('o');
49
-        $qb->where('o.orderdate < ' . date('Y-m-d'));
49
+        $qb->where('o.orderdate < '.date('Y-m-d'));
50 50
         
51 51
         $createForm = $this->createCreateForm('orders_create');
52 52
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         $orders = new Orders();
116 116
         $form = $this->createForm(OrdersType::class, $orders);
117
-        $return = ['orders' => $orders, 'form' => $form->createView(),];
117
+        $return = ['orders' => $orders, 'form' => $form->createView(), ];
118 118
         $form->handleRequest($request);
119 119
         $supplier = $orders->getSupplier();
120 120
         $articles = $etm->getRepository('AppBundle:Article')->getArticleFromSupplier($supplier->getId());
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
             if ($date >= date('w')) {
231 231
                 $diffOrder = $date - date('w');
232 232
                 $diffDeliv = $diffOrder + $supplier->getDelaydeliv();
233
-                $dateOrder = date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date('j')+$diffOrder, date('Y')));
234
-                $delivDate = date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date('j')+$diffDeliv, date('Y')));
233
+                $dateOrder = date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date('j') + $diffOrder, date('Y')));
234
+                $delivDate = date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date('j') + $diffDeliv, date('Y')));
235 235
                 $orders->setOrderDate(\DateTime::createFromFormat('Y-m-d H:i:s', $dateOrder));
236 236
                 $orders->setDelivDate(\DateTime::createFromFormat('Y-m-d H:i:s', $delivDate));
237 237
                 break;
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      */
276 276
     public function printAction(Orders $orders)
277 277
     {
278
-        $file = 'order-' . $orders->getId() . '.pdf';
278
+        $file = 'order-'.$orders->getId().'.pdf';
279 279
         $company = $this->getDoctrine()->getManager()->getRepository('AppBundle:Company')->find(1);
280 280
         // Create and save the PDF file to print
281 281
         $html = $this->renderView(
@@ -285,12 +285,12 @@  discard block
 block discarded – undo
285 285
         return new Response(
286 286
             $this->get('knp_snappy.pdf')->getOutputFromHtml(
287 287
                 $html,
288
-                $this->getArray((string)date('d/m/y - H:i:s'), '')
288
+                $this->getArray((string) date('d/m/y - H:i:s'), '')
289 289
             ),
290 290
             200,
291 291
             array(
292 292
                 'Content-Type' => 'application/pdf',
293
-                'Content-Disposition' => 'attachment; filename="' . $file . '"'
293
+                'Content-Disposition' => 'attachment; filename="'.$file.'"'
294 294
             )
295 295
         );
296 296
     }
Please login to merge, or discard this patch.
src/AppBundle/Entity/Orders.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     /**
159 159
      * Get amount
160 160
      *
161
-     * @return string
161
+     * @return double
162 162
      */
163 163
     public function getAmount()
164 164
     {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     /**
182 182
      * Get tva
183 183
      *
184
-     * @return string
184
+     * @return double
185 185
      */
186 186
     public function getTva()
187 187
     {
Please login to merge, or discard this patch.