Completed
Push — master ( 98c39c...c8155d )
by Pavel
16:50
created
src/DependencyInjection/CrudsEntitiesConfigurator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@
 block discarded – undo
227 227
      * @param string $actionName
228 228
      * @param string $path
229 229
      * @param string $action
230
-     * @param array  $methods
230
+     * @param string[]  $methods
231 231
      * @param array  $options
232 232
      *
233 233
      * @return Definition
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $mount      = $config['mount'];
43 43
 
44 44
         if (null === $manager) {
45
-            $manager    = $this->normalize('cruds.class_' . $class . '.object_manager');
45
+            $manager    = $this->normalize('cruds.class_'.$class.'.object_manager');
46 46
             $managerDef = new Definition(ObjectManager::class);
47 47
             $managerDef->setPublic(false);
48 48
             $managerDef->setFactory([new Reference('doctrine'), 'getManagerForClass']);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $manager = new Reference($this->filterReference($manager));
53 53
 
54 54
         if (null === $repository) {
55
-            $repository    = $this->normalize('cruds.class_' . $class . '.entity_repository');
55
+            $repository    = $this->normalize('cruds.class_'.$class.'.entity_repository');
56 56
             $repositoryDef = new Definition(EntityRepository::class);
57 57
             $repositoryDef->setPublic(false);
58 58
             $repositoryDef->setFactory([$manager, 'getRepository']);
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
             $actionConfig['class']      = $class;
72 72
             $actionConfig['mount']      = $mount;
73 73
             $actionConfig['repository'] = $repository;
74
-            $actionConfig['path']       = $prefix . $actionConfig['path'];
74
+            $actionConfig['path']       = $prefix.$actionConfig['path'];
75 75
             $actionConfig['manager']    = $manager;
76 76
             $actionConfig['prefix']     = $prefix;
77
-            $function                   = new \ReflectionMethod($this, 'register' . ucfirst($action) . 'Action');
77
+            $function                   = new \ReflectionMethod($this, 'register'.ucfirst($action).'Action');
78 78
             $args                       = [];
79 79
 
80 80
             foreach ($function->getParameters() as $parameter) {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $controllerId = $this->generateControllerId($name, $actionName);
95 95
 
96 96
         if (null === $factory) {
97
-            $factory = $controllerId . '.entity_factory';
97
+            $factory = $controllerId.'.entity_factory';
98 98
 
99 99
             if (class_exists(ChildDefinition::class)) {
100 100
                 $factoryDef = new ChildDefinition('cruds.factory.reflection');
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
         $this->container->setDefinition($controllerId, $definition);
131 131
 
132
-        $action = $controllerId . ':' . CreateController::ACTION;
132
+        $action = $controllerId.':'.CreateController::ACTION;
133 133
         $this->registerRoute(
134 134
             $mount,
135 135
             $name,
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         $controllerId = $this->generateControllerId($name, $actionName);
157 157
         $this->container->setDefinition($controllerId, $definition);
158 158
 
159
-        $action = $controllerId . ':' . ReadController::ACTION;
159
+        $action = $controllerId.':'.ReadController::ACTION;
160 160
         $this->registerRoute(
161 161
             $mount,
162 162
             $name,
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         $controllerId = $this->generateControllerId($name, $actionName);
192 192
         $this->container->setDefinition($controllerId, $definition);
193 193
 
194
-        $action = $controllerId . ':' . UpdateController::ACTION;
194
+        $action = $controllerId.':'.UpdateController::ACTION;
195 195
         $this->registerRoute(
196 196
             $mount,
197 197
             $name,
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $controllerId = $controllerId = $this->generateControllerId($name, $actionName);
221 221
         $this->container->setDefinition($controllerId, $definition);
222 222
 
223
-        $action = $controllerId . ':' . DeleteController::ACTION;
223
+        $action = $controllerId.':'.DeleteController::ACTION;
224 224
         $definition->setPublic(true);
225 225
         $this->registerRoute(
226 226
             $mount,
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         $controllerId = $this->generateControllerId($name, $actionName);
271 271
         $this->container->setDefinition($controllerId, $definition);
272 272
 
273
-        $action = $controllerId . ':' . SearchController::ACTION;
273
+        $action = $controllerId.':'.SearchController::ACTION;
274 274
         $this->registerRoute(
275 275
             $mount,
276 276
             $name,
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
         $controllerId = $this->generateControllerId($name, $actionName);
297 297
         $this->container->setDefinition($controllerId, $definition);
298 298
 
299
-        $action = $controllerId . ':' . CountController::ACTION;
299
+        $action = $controllerId.':'.CountController::ACTION;
300 300
         $this->registerRoute(
301 301
             $mount,
302 302
             $name,
303 303
             $actionName,
304
-            $prefix . $count_path,
304
+            $prefix.$count_path,
305 305
             $action,
306 306
             ['GET', 'POST'],
307 307
             ['class' => $class, 'arguments' => ['criteria']]
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
     private function generateControllerId(string $name, string $actionName): string
325 325
     {
326
-        return $this->normalize('cruds.generated_controller.' . $name . '.' . $actionName);
326
+        return $this->normalize('cruds.generated_controller.'.$name.'.'.$actionName);
327 327
     }
328 328
 
329 329
     /**
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
             'addRoute',
362 362
             [
363 363
                 $mount,
364
-                $this->normalize('cruds.routing.' . $name . '.' . $actionName),
364
+                $this->normalize('cruds.routing.'.$name.'.'.$actionName),
365 365
                 $path,
366 366
                 $action,
367 367
                 $methods,
Please login to merge, or discard this patch.
tests/Unit/Controller/SearchControllerTest.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,6 +95,9 @@  discard block
 block discarded – undo
95 95
         self::assertSame([$f1, $f2, $f3, $f4], $result->toArray());
96 96
     }
97 97
 
98
+    /**
99
+     * @param integer $a
100
+     */
98 101
     private function createFixture($a, $b, $c)
99 102
     {
100 103
         $entity    = new AbcClass();
@@ -106,7 +109,7 @@  discard block
 block discarded – undo
106 109
     }
107 110
 
108 111
     /**
109
-     * @return ReferenceProviderInterface|\PHPUnit_Framework_MockObject_MockObject
112
+     * @return ReferenceProviderInterface
110 113
      */
111 114
     private function getReferenceProvider()
112 115
     {
Please login to merge, or discard this patch.
tests/Fixtures/SymfonySerializer/SymfonyTestKernel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@
 block discarded – undo
13 13
     {
14 14
         parent::registerContainerConfiguration($loader);
15 15
 
16
-        $loader->load(__DIR__ . '/config.yml');
16
+        $loader->load(__DIR__.'/config.yml');
17 17
     }
18 18
 
19 19
     /** {@inheritdoc} */
20 20
     protected function buildContainer()
21 21
     {
22 22
         $container = parent::buildContainer();
23
-        $container->addResource(new FileResource(__DIR__ . '/config.yml'));
23
+        $container->addResource(new FileResource(__DIR__.'/config.yml'));
24 24
 
25 25
         return $container;
26 26
     }
Please login to merge, or discard this patch.
tests/Fixtures/JmsSerializer/JmsTestKernel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     {
15 15
         parent::registerContainerConfiguration($loader);
16 16
 
17
-        return $loader->load(__DIR__ . '/config.yml');
17
+        return $loader->load(__DIR__.'/config.yml');
18 18
     }
19 19
 
20 20
     /** {@inheritdoc} */
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     protected function buildContainer()
31 31
     {
32 32
         $container = parent::buildContainer();
33
-        $container->addResource(new FileResource(__DIR__ . '/config.yml'));
33
+        $container->addResource(new FileResource(__DIR__.'/config.yml'));
34 34
 
35 35
         return $container;
36 36
     }
Please login to merge, or discard this patch.
tests/Fixtures/Common/CrudsTestKernel.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,24 +27,24 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function getLogDir()
29 29
     {
30
-        return __DIR__ . '/../../../build/' . $this->getClassName() . '/logs';
30
+        return __DIR__.'/../../../build/'.$this->getClassName().'/logs';
31 31
     }
32 32
 
33 33
     /** {@inheritdoc} */
34 34
     public function registerContainerConfiguration(LoaderInterface $loader)
35 35
     {
36
-        return $loader->load(__DIR__ . '/config.yml');
36
+        return $loader->load(__DIR__.'/config.yml');
37 37
     }
38 38
 
39 39
     public function getCacheDir()
40 40
     {
41
-        return __DIR__ . '/../../../build/' . $this->getClassName() . '/cache';
41
+        return __DIR__.'/../../../build/'.$this->getClassName().'/cache';
42 42
     }
43 43
 
44 44
     protected function initializeContainer()
45 45
     {
46 46
         $class = $this->getContainerClass();
47
-        $cache = new ConfigCache($this->getCacheDir() . '/' . $class . '.php', $this->debug);
47
+        $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
48 48
 
49 49
         $container = $this->buildContainer();
50 50
         $container->compile();
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
     protected function buildContainer()
58 58
     {
59 59
         $container = parent::buildContainer();
60
-        $container->addResource(new FileResource(__DIR__ . '/config.yml'));
61
-        $container->addResource(new FileResource(__DIR__ . '/routing.yml'));
60
+        $container->addResource(new FileResource(__DIR__.'/config.yml'));
61
+        $container->addResource(new FileResource(__DIR__.'/routing.yml'));
62 62
 
63 63
         return $container;
64 64
     }
Please login to merge, or discard this patch.
tests/Unit/DefaultCriteriaConfiguratorTest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     {
49 49
         $mock = self::prophesize(CriteriaConfiguratorInterface::class);
50 50
         $mock->configure(Argument::exact($fqcn), Argument::exact($criteria), Argument::exact($data))
51
-             ->shouldBeCalled();
51
+                ->shouldBeCalled();
52 52
 
53 53
         return $mock->reveal();
54 54
     }
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.
src/DependencyInjection/Configuration.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             ->defaultValue('api')
72 72
             ->cannotBeEmpty()
73 73
             ->info(
74
-                'Route mount. You can create different entries ' .
74
+                'Route mount. You can create different entries '.
75 75
                 'with different mounts. You can use this value when loading routes'
76 76
             )
77 77
             ->example('my-mount-name');
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             ->scalarNode('repository')
82 82
             ->defaultNull()
83 83
             ->info(
84
-                'Object repository. service reference,' . PHP_EOL .
84
+                'Object repository. service reference,'.PHP_EOL.
85 85
                 'default to factory-acquired doctrine repository for class'
86 86
             )
87 87
             ->example('@my_entity.repository');
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             ->scalarNode('manager')
92 92
             ->defaultNull()
93 93
             ->info(
94
-                'Object manager. service reference,' . PHP_EOL .
94
+                'Object manager. service reference,'.PHP_EOL.
95 95
                 'default to factory-acquired doctrine manager for class'
96 96
             )
97 97
             ->example('@my_entity.repository');
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             ->beforeNormalization()
105 105
             ->ifArray()
106 106
             ->then(
107
-                function (array $v) {
107
+                function(array $v) {
108 108
                     if (array_keys($v) !== range(0, count($v) - 1)) {
109 109
                         return $v;
110 110
                     }
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
             ->defaultNull()
140 140
             ->example('@my_entity.factory')
141 141
             ->info(
142
-                'Service ID implementing ' . PHP_EOL .
143
-                EntityFactoryInterface::class . PHP_EOL .
144
-                'Defaults to ' . ReflectionConstructorFactory::class
142
+                'Service ID implementing '.PHP_EOL.
143
+                EntityFactoryInterface::class.PHP_EOL.
144
+                'Defaults to '.ReflectionConstructorFactory::class
145 145
             );
146 146
 
147 147
         $create
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
             ->defaultNull()
151 151
             ->example('@my_entity.factory')
152 152
             ->info(
153
-                'Service ID implementing ' . PHP_EOL .
154
-                EntityFactoryInterface::class . PHP_EOL .
155
-                'Defaults to ' . ReflectionConstructorFactory::class
153
+                'Service ID implementing '.PHP_EOL.
154
+                EntityFactoryInterface::class.PHP_EOL.
155
+                'Defaults to '.ReflectionConstructorFactory::class
156 156
             );
157 157
 
158 158
         $this->configureActionNode($create, 'create');
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
         $criteria = $search->children()->variableNode('criteria');
175 175
         $criteria->info(
176
-            'Criteria modifiers. Array will be treated as nested criteria,' . PHP_EOL .
176
+            'Criteria modifiers. Array will be treated as nested criteria,'.PHP_EOL.
177 177
             'allowing configuring several modifiers by key:value'
178 178
         );
179 179
         $criteria->defaultValue('cruds.criteria.entity');
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
             ->defaultNull()
202 202
             ->example('@my_entity.processor')
203 203
             ->info(
204
-                'Service ID implementing ' . PHP_EOL .
205
-                EntityProcessorInterface::class . PHP_EOL .
206
-                'Defaults to ' . PropertyAccessProcessor::class
204
+                'Service ID implementing '.PHP_EOL.
205
+                EntityProcessorInterface::class.PHP_EOL.
206
+                'Defaults to '.PropertyAccessProcessor::class
207 207
             );
208 208
 
209 209
         $this->configureActionNode($update, 'update');
@@ -225,6 +225,6 @@  discard block
 block discarded – undo
225 225
             ->children()
226 226
             ->scalarNode('path')
227 227
             ->info('Action path (will be prefixed with entity prefix)')
228
-            ->defaultValue('/' . $action);
228
+            ->defaultValue('/'.$action);
229 229
     }
230 230
 }
Please login to merge, or discard this patch.
src/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.