Completed
Push — dev ( a083dd...a1297d )
by Arnaud
02:53
created
Tests/AdminBundle/Admin/AdminTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@
 block discarded – undo
20 20
         }
21 21
     }
22 22
 
23
+    /**
24
+     * @param string $adminName
25
+     */
23 26
     protected function doTestAdmin(AdminInterface $admin, array $configuration, $adminName)
24 27
     {
25 28
         $this->assertEquals($admin->getName(), $adminName);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 
41 41
 
42 42
             // with no action, handleRequest method SHOULD throw an exception
43
-            $this->assertExceptionRaised('Exception', function () use ($admin) {
43
+            $this->assertExceptionRaised('Exception', function() use ($admin) {
44 44
                 $request = new Request();
45 45
                 $admin->handleRequest($request);
46 46
             });
47 47
 
48 48
             // with a wrong action, handleRequest method SHOULD throw an exception
49
-            $this->assertExceptionRaised('Exception', function () use ($admin) {
49
+            $this->assertExceptionRaised('Exception', function() use ($admin) {
50 50
                 $request = new Request([], [], [
51 51
                     '_route_params' => [
52 52
                         '_action' => 'bad_action'
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
             $this->doTestAdmin($admin, $configuration, $adminName);
76 76
 
77 77
             // with a current action unset, checkPermissions method SHOULD throw an exception
78
-            $this->assertExceptionRaised('Exception', function () use ($admin) {
78
+            $this->assertExceptionRaised('Exception', function() use ($admin) {
79 79
                 $user = new User('JohnKrovitch', 'john1234');
80 80
                 $admin->checkPermissions($user);
81 81
             });
82 82
 
83 83
             // with the wrong roles, checkPermissions method SHOULD throw an exception
84
-            $this->assertExceptionRaised(NotFoundHttpException::class, function () use ($admin) {
84
+            $this->assertExceptionRaised(NotFoundHttpException::class, function() use ($admin) {
85 85
                 $request = new Request([], [], [
86 86
                     '_route_params' => [
87 87
                         '_action' => 'custom_list'
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             });
94 94
 
95 95
             // with the wrong roles, checkPermissions method SHOULD throw an exception
96
-            $this->assertExceptionRaised(NotFoundHttpException::class, function () use ($admin) {
96
+            $this->assertExceptionRaised(NotFoundHttpException::class, function() use ($admin) {
97 97
                 $request = new Request([], [], [
98 98
                     '_route_params' => [
99 99
                         '_action' => 'custom_list'
Please login to merge, or discard this patch.
Admin/Configuration/ApplicationConfiguration.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             'url_pattern',
147 147
             'name_pattern',
148 148
         ]);
149
-        $resolver->setNormalizer('url_pattern', function (Options $options, $value) {
149
+        $resolver->setNormalizer('url_pattern', function(Options $options, $value) {
150 150
             if (strstr($value, '{admin}') === false) {
151 151
                 throw new InvalidOptionsException('Admin routing configuration url pattern should contains {admin} placeholder');
152 152
             }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
             return $value;
158 158
         });
159
-        $resolver->setNormalizer('name_pattern', function (Options $options, $value) {
159
+        $resolver->setNormalizer('name_pattern', function(Options $options, $value) {
160 160
             if (strstr($value, '{admin}') === false) {
161 161
                 throw new InvalidOptionsException('Admin routing configuration pattern name should contains {admin} placeholder');
162 162
             }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             ->clear()
175 175
             ->setDefault('enabled', true)
176 176
             ->setDefault('pattern', 'lag.admin.{key}');
177
-        $resolver->setNormalizer('pattern', function (Options $options, $value) {
177
+        $resolver->setNormalizer('pattern', function(Options $options, $value) {
178 178
             if (strstr($value, 'key') === false) {
179 179
                 throw new InvalidOptionsException('Admin translation configuration pattern should contains {key} placeholder');
180 180
             }
Please login to merge, or discard this patch.
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      * ApplicationConfiguration constructor.
119 119
      *
120 120
      * @param array $applicationConfiguration
121
-     * @param $locale
121
+     * @param string $locale
122 122
      */
123 123
     public function __construct(array $applicationConfiguration = [], $locale)
124 124
     {
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     }
224 224
 
225 225
     /**
226
-     * @return mixed
226
+     * @return string
227 227
      */
228 228
     public function getTitle()
229 229
     {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     }
240 240
 
241 241
     /**
242
-     * @return mixed
242
+     * @return string
243 243
      */
244 244
     public function getLayout()
245 245
     {
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     }
256 256
 
257 257
     /**
258
-     * @return mixed
258
+     * @return string
259 259
      */
260 260
     public function getBlockTemplate()
261 261
     {
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
     }
272 272
 
273 273
     /**
274
-     * @return mixed
274
+     * @return string
275 275
      */
276 276
     public function getDescription()
277 277
     {
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     }
304 304
 
305 305
     /**
306
-     * @return mixed
306
+     * @return string
307 307
      */
308 308
     public function getDateFormat()
309 309
     {
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
     }
398 398
 
399 399
     /**
400
-     * @return mixed
400
+     * @return integer
401 401
      */
402 402
     public function getStringLengthTruncate()
403 403
     {
Please login to merge, or discard this patch.
Admin/Factory/ActionFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                 Admin::LOAD_STRATEGY_UNIQUE,
158 158
                 Admin::LOAD_STRATEGY_MULTIPLE,
159 159
             ])
160
-            ->setNormalizer('route', function (Options $options, $value) use ($admin, $actionName) {
160
+            ->setNormalizer('route', function(Options $options, $value) use ($admin, $actionName) {
161 161
                 if (!$value) {
162 162
                     // if no route was provided, it should be linked to an Admin
163 163
                     if (!$admin) {
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 }
169 169
                 return $value;
170 170
             })
171
-            ->setNormalizer('title', function (Options $options, $value) use ($admin, $actionName) {
171
+            ->setNormalizer('title', function(Options $options, $value) use ($admin, $actionName) {
172 172
                 if (!$value) {
173 173
                     $adminKey = '';
174 174
                     // if an Admin is linked to this action, we use its name in translation key
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                 }
180 180
                 return $value;
181 181
             })
182
-            ->setNormalizer('batch', function (Options $options, $value) use ($admin, $actionName) {
182
+            ->setNormalizer('batch', function(Options $options, $value) use ($admin, $actionName) {
183 183
                 if ($value) {
184 184
                     if (!is_array($value)) {
185 185
                         $value = [$value];
Please login to merge, or discard this patch.
DependencyInjection/FieldCompilerPass.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         // foreach tagged, with add this field type to the field factory
26 26
         foreach ($taggedServices as $id => $tags) {
27 27
             if (empty($tags[0]['type'])) {
28
-                throw new InvalidConfigurationException('You should defined a "type" attribute for field tag for service '.$id);
28
+                throw new InvalidConfigurationException('You should defined a "type" attribute for field tag for service ' . $id);
29 29
             }
30 30
             // add allowed field type to the field factory
31 31
             $definition->addMethodCall('addFieldMapping', [
Please login to merge, or discard this patch.
DependencyInjection/LAGAdminExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
         $configuration = new Configuration();
23 23
         $config = $this->processConfiguration($configuration, $configs);
24 24
 
25
-        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
25
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
26 26
         $loader->load('services.yml');
27 27
 
28 28
         $container->setParameter('bluebear.admins', $config['admins']);
Please login to merge, or discard this patch.
Form/Handler/ListFormHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         }
35 35
         // check if they exists in entities displayed and if checkbox is checked
36 36
         foreach ($batchItems as $name => $batchItem) {
37
-            $batchId = (int)str_replace('batch_', '', $name);
37
+            $batchId = (int) str_replace('batch_', '', $name);
38 38
 
39 39
             if (array_key_exists($batchId, $cleanData['labels']) && $batchItem === true) {
40 40
                 $cleanData['ids'][] = $batchId;
Please login to merge, or discard this patch.
Form/Type/AdminListType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
                     ]
33 33
                 ])
34 34
             ;
35
-            $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
35
+            $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) {
36 36
                 $data = $event->getData();
37 37
                 $form = $event->getForm();
38 38
 
Please login to merge, or discard this patch.
Routing/RoutingLoader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $path = str_replace('{action}', $action->getName(), $path);
94 94
         // by default, generic controller
95 95
         $defaults = [
96
-            '_controller' => $admin->getConfiguration()->getControllerName().':'.$action->getName(),
96
+            '_controller' => $admin->getConfiguration()->getControllerName() . ':' . $action->getName(),
97 97
             '_admin' => $admin->getName(),
98 98
             '_action' => $action->getName(),
99 99
         ];
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     {
136 136
         $array = explode('\\', $namespace);
137 137
         $path = array_pop($array);
138
-        $path = strtolower(substr($path, 0, 1)).substr($path, 1);
138
+        $path = strtolower(substr($path, 0, 1)) . substr($path, 1);
139 139
 
140 140
         return $path;
141 141
     }
Please login to merge, or discard this patch.
Tests/Base.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -259,7 +259,7 @@
 block discarded – undo
259 259
         $repository = $this->mockEntityRepository();
260 260
         $repository
261 261
             ->method('getEntityPersister')
262
-            ->willReturn( $this
262
+            ->willReturn($this
263 263
                 ->getMockBuilder('Doctrine\ORM\Persisters\Entity\BasicEntityPersister')
264 264
                 ->disableOriginalConstructor()
265 265
                 ->getMock());
Please login to merge, or discard this patch.
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
     }
125 125
 
126 126
     /**
127
-     * @param $name
128
-     * @param $configuration
127
+     * @param string $name
128
+     * @param \LAG\AdminBundle\Admin\Configuration\AdminConfiguration $configuration
129 129
      * @return Admin
130 130
      */
131 131
     protected function mockAdmin($name, $configuration)
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     /**
142 142
      * @param $name
143
-     * @return ActionInterface|PHPUnit_Framework_MockObject_MockObject
143
+     * @return ActionInterface
144 144
      */
145 145
     protected function mockAction($name)
146 146
     {
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     /**
243 243
      * Return a mock of an entity repository
244 244
      *
245
-     * @return RepositoryInterface|PHPUnit_Framework_MockObject_MockObject
245
+     * @return RepositoryInterface
246 246
      */
247 247
     protected function mockEntityRepository()
248 248
     {
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     }
281 281
 
282 282
     /**
283
-     * @return ActionFactory|PHPUnit_Framework_MockObject_MockObject
283
+     * @return ActionFactory
284 284
      */
285 285
     protected function mockActionFactory()
286 286
     {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     }
323 323
 
324 324
     /**
325
-     * @return MessageHandlerInterface|PHPUnit_Framework_MockObject_MockObject
325
+     * @return MessageHandlerInterface
326 326
      */
327 327
     protected function mockMessageHandler()
328 328
     {
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
     }
346 346
 
347 347
     /**
348
-     * @return DataProviderInterface|PHPUnit_Framework_MockObject_MockObject
348
+     * @return DataProviderInterface
349 349
      */
350 350
     protected function mockDataProvider()
351 351
     {
Please login to merge, or discard this patch.