Completed
Pull Request — master (#21)
by Pavel
22:01
created
DependencyInjection/Compiler/DoctrineOrmCompilerPass.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
             return;
22 22
         }
23 23
 
24
-        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../../Resources/config'));
24
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config'));
25 25
         $loader->load('doctrine.yml');
26 26
 
27 27
         $factory = $container->getDefinition('cruds.factory.reflection');
Please login to merge, or discard this patch.
DependencyInjection/CrudsExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     /** {@inheritdoc} */
13 13
     public function load(array $configs, ContainerBuilder $container)
14 14
     {
15
-        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
15
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
16 16
         $loader->load('cruds.yml');
17 17
 
18 18
         $config = $this->processConfiguration($this->getConfiguration([], $container), $configs);
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $configurator = new CrudsEntitiesConfigurator($container);
21 21
         $container->addObjectResource($configurator);
22 22
         foreach ($config['entities'] as $name => $entityConfig) {
23
-            $entityConfig['prefix'] = $entityConfig['prefix'] ?: '/' . $name;
23
+            $entityConfig['prefix'] = $entityConfig['prefix'] ?: '/'.$name;
24 24
             $configurator->processEntityConfiguration($name, $entityConfig);
25 25
         }
26 26
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 continue;
30 30
             }
31 31
 
32
-            $container->removeDefinition('cruds.api.listener.' . $listener);
32
+            $container->removeDefinition('cruds.api.listener.'.$listener);
33 33
         }
34 34
     }
35 35
 }
Please login to merge, or discard this patch.
DependencyInjection/Configuration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
             ->beforeNormalization()
92 92
             ->ifArray()
93 93
             ->then(
94
-                function (array $v) {
94
+                function(array $v) {
95 95
                     if (array_keys($v) !== range(0, count($v) - 1)) {
96 96
                         return $v;
97 97
                     }
Please login to merge, or discard this patch.
Tests/Unit/Controller/CountControllerTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use ScayTrase\Api\Cruds\PublicPropertyMapper;
11 11
 use ScayTrase\Api\Cruds\ReferenceProviderInterface;
12 12
 use ScayTrase\Api\Cruds\Tests\Fixtures\AbcClass;
13
-use ScayTrase\Api\Cruds\Tests\Unit\AbstractControllerTest;
14 13
 use Symfony\Component\EventDispatcher\Event;
15 14
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
16 15
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,6 +49,9 @@  discard block
 block discarded – undo
49 49
         self::assertSame(3, $controller->countAction(['a' => [1, 2, 4]]));
50 50
     }
51 51
 
52
+    /**
53
+     * @param integer $a
54
+     */
52 55
     private function createFixture($a, $b, $c)
53 56
     {
54 57
         $entity    = new AbcClass();
@@ -60,7 +63,7 @@  discard block
 block discarded – undo
60 63
     }
61 64
 
62 65
     /**
63
-     * @return ReferenceProviderInterface|\PHPUnit_Framework_MockObject_MockObject
66
+     * @return \PHPUnit\Framework\MockObject\MockObject
64 67
      */
65 68
     private function getReferenceProvider()
66 69
     {
Please login to merge, or discard this patch.
DependencyInjection/Compiler/SymfonyFormsCompilerPass.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
             return;
17 17
         }
18 18
 
19
-        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../../Resources/config'));
19
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config'));
20 20
         $loader->load('forms.yml');
21 21
     }
22 22
 }
Please login to merge, or discard this patch.
Tests/KernelProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@
 block discarded – undo
17 17
     public static function getClass()
18 18
     {
19 19
         if (false === ($alias = getenv(self::ENV_VAR))) {
20
-            throw new \LogicException('Cannot obtain kernel alias from "' . self::ENV_VAR . '"" ENV variable');
20
+            throw new \LogicException('Cannot obtain kernel alias from "'.self::ENV_VAR.'"" ENV variable');
21 21
         }
22 22
 
23 23
         if (!array_key_exists($alias, self::$map)) {
24
-            throw new \LogicException('Invalid kernel alias: ' . $alias);
24
+            throw new \LogicException('Invalid kernel alias: '.$alias);
25 25
         }
26 26
 
27 27
         return self::$map[$alias];
Please login to merge, or discard this patch.
dump_reference.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use ScayTrase\Api\Cruds\DependencyInjection\Configuration;
4 4
 use Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper;
5 5
 
6
-require_once __DIR__ . '/bootstrap.php';
6
+require_once __DIR__.'/bootstrap.php';
7 7
 
8 8
 $config = new Configuration();
9 9
 $dumper = new YamlReferenceDumper();
Please login to merge, or discard this patch.
Exception/EntityProcessingException.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
 
36 36
         return new static(
37
-            'Invalid data submitted for entity: ' . PHP_EOL .
37
+            'Invalid data submitted for entity: '.PHP_EOL.
38 38
             Yaml::dump($errors)
39 39
         );
40 40
     }
Please login to merge, or discard this patch.
DependencyInjection/CrudsEntitiesConfigurator.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@
 block discarded – undo
344 344
      * @param string $actionName
345 345
      * @param string $path
346 346
      * @param string $action
347
-     * @param array $methods
347
+     * @param string[] $methods
348 348
      * @param array $options
349 349
      *
350 350
      * @return Definition
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 use ScayTrase\Api\Cruds\Controller\SearchController;
12 12
 use ScayTrase\Api\Cruds\Controller\UpdateController;
13 13
 use ScayTrase\Api\Cruds\Criteria\NestedCriteriaConfigurator;
14
-use ScayTrase\Api\Cruds\ReflectionConstructorFactory;
15 14
 use Symfony\Component\DependencyInjection\ChildDefinition;
16 15
 use Symfony\Component\DependencyInjection\DefinitionDecorator;
17 16
 use Symfony\Component\DependencyInjection\ContainerBuilder;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $mount = $config['mount'];
44 44
 
45 45
         if (null === $manager) {
46
-            $manager = 'cruds.class_' . $class . '.object_manager';
46
+            $manager = 'cruds.class_'.$class.'.object_manager';
47 47
             $managerDef = new Definition(ObjectManager::class);
48 48
             $managerDef->setPublic(false);
49 49
             $managerDef->setFactory([new Reference('doctrine'), 'getManagerForClass']);
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $manager = new Reference($this->filterReference($manager));
54 54
 
55 55
         if (null === $repository) {
56
-            $repository = 'cruds.class_' . $class . '.entity_repository';
56
+            $repository = 'cruds.class_'.$class.'.entity_repository';
57 57
             $repositoryDef = new Definition(EntityRepository::class);
58 58
             $repositoryDef->setPublic(false);
59 59
             $repositoryDef->setFactory([$manager, 'getRepository']);
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
             $actionConfig['class'] = $class;
73 73
             $actionConfig['mount'] = $mount;
74 74
             $actionConfig['repository'] = $repository;
75
-            $actionConfig['path'] = $prefix . $actionConfig['path'];
75
+            $actionConfig['path'] = $prefix.$actionConfig['path'];
76 76
             $actionConfig['manager'] = $manager;
77 77
             $actionConfig['prefix'] = $prefix;
78
-            $function = new \ReflectionMethod($this, 'register' . ucfirst($action) . 'Action');
78
+            $function = new \ReflectionMethod($this, 'register'.ucfirst($action).'Action');
79 79
             $args = [];
80 80
 
81 81
             foreach ($function->getParameters() as $parameter) {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $controllerId = $this->generateControllerId($name, $actionName);
96 96
 
97 97
         if (null === $factory) {
98
-            $factory = $controllerId . '.entity_factory';
98
+            $factory = $controllerId.'.entity_factory';
99 99
 
100 100
             if (class_exists(ChildDefinition::class)) {
101 101
                 $factoryDef = new ChildDefinition('cruds.factory.reflection');
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
         $this->container->setDefinition($controllerId, $definition);
133 133
 
134
-        $action = $controllerId . ':' . CreateController::ACTION;
134
+        $action = $controllerId.':'.CreateController::ACTION;
135 135
         $this->registerRoute(
136 136
             $mount,
137 137
             $name,
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         $controllerId = $this->generateControllerId($name, $actionName);
159 159
         $this->container->setDefinition($controllerId, $definition);
160 160
 
161
-        $action = $controllerId . ':' . ReadController::ACTION;
161
+        $action = $controllerId.':'.ReadController::ACTION;
162 162
         $this->registerRoute(
163 163
             $mount,
164 164
             $name,
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $controllerId = $this->generateControllerId($name, $actionName);
194 194
         $this->container->setDefinition($controllerId, $definition);
195 195
 
196
-        $action = $controllerId . ':' . UpdateController::ACTION;
196
+        $action = $controllerId.':'.UpdateController::ACTION;
197 197
         $this->registerRoute(
198 198
             $mount,
199 199
             $name,
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         $controllerId = $controllerId = $this->generateControllerId($name, $actionName);
223 223
         $this->container->setDefinition($controllerId, $definition);
224 224
 
225
-        $action = $controllerId . ':' . DeleteController::ACTION;
225
+        $action = $controllerId.':'.DeleteController::ACTION;
226 226
         $definition->setPublic(true);
227 227
         $this->registerRoute(
228 228
             $mount,
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         $controllerId = $this->generateControllerId($name, $actionName);
273 273
         $this->container->setDefinition($controllerId, $definition);
274 274
 
275
-        $action = $controllerId . ':' . SearchController::ACTION;
275
+        $action = $controllerId.':'.SearchController::ACTION;
276 276
         $this->registerRoute(
277 277
             $mount,
278 278
             $name,
@@ -298,12 +298,12 @@  discard block
 block discarded – undo
298 298
         $controllerId = $this->generateControllerId($name, $actionName);
299 299
         $this->container->setDefinition($controllerId, $definition);
300 300
 
301
-        $action = $controllerId . ':' . CountController::ACTION;
301
+        $action = $controllerId.':'.CountController::ACTION;
302 302
         $this->registerRoute(
303 303
             $mount,
304 304
             $name,
305 305
             $actionName,
306
-            $prefix . $count_path,
306
+            $prefix.$count_path,
307 307
             $action,
308 308
             ['GET', 'POST'],
309 309
             ['class' => $class, 'arguments' => ['criteria']]
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
     private function generateControllerId(string $name, string $actionName): string
327 327
     {
328
-        return $this->normalize('cruds.generated_controller.' . $name . '.' . $actionName);
328
+        return $this->normalize('cruds.generated_controller.'.$name.'.'.$actionName);
329 329
     }
330 330
 
331 331
     /**
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             'addRoute',
364 364
             [
365 365
                 $mount,
366
-                $this->normalize('cruds.routing.' . $name . '.' . $actionName),
366
+                $this->normalize('cruds.routing.'.$name.'.'.$actionName),
367 367
                 $path,
368 368
                 $action,
369 369
                 $methods,
Please login to merge, or discard this patch.