@@ -21,7 +21,7 @@ |
||
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'); |
@@ -12,7 +12,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -91,7 +91,7 @@ |
||
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 | } |
@@ -10,7 +10,6 @@ |
||
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 |
@@ -49,6 +49,9 @@ discard block |
||
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 |
||
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 | { |
@@ -16,7 +16,7 @@ |
||
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 | } |
@@ -17,11 +17,11 @@ |
||
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]; |
@@ -3,7 +3,7 @@ |
||
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(); |
@@ -34,7 +34,7 @@ |
||
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 | } |
@@ -344,7 +344,7 @@ |
||
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 |
@@ -11,7 +11,6 @@ |
||
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; |
@@ -43,7 +43,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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, |