@@ -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'); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | throw new EntityProcessingException( |
41 | 41 | 'Data for the entity is not valid', |
42 | 42 | array_map( |
43 | - function (ConstraintViolationInterface $violation) { |
|
43 | + function(ConstraintViolationInterface $violation) { |
|
44 | 44 | return $violation->getMessage(); |
45 | 45 | }, |
46 | 46 | iterator_to_array($list) |
@@ -227,7 +227,7 @@ |
||
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 |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | $actionConfig['class'] = $class; |
66 | 66 | $actionConfig['mount'] = $mount; |
67 | 67 | $actionConfig['repository'] = $repositoryDefinition; |
68 | - $actionConfig['path'] = $prefix . $actionConfig['path']; |
|
68 | + $actionConfig['path'] = $prefix.$actionConfig['path']; |
|
69 | 69 | $actionConfig['manager'] = $manager; |
70 | 70 | $actionConfig['prefix'] = $prefix; |
71 | - $function = new \ReflectionMethod($this, 'register' . ucfirst($action) . 'Action'); |
|
71 | + $function = new \ReflectionMethod($this, 'register'.ucfirst($action).'Action'); |
|
72 | 72 | $args = []; |
73 | 73 | |
74 | 74 | foreach ($function->getParameters() as $parameter) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $controllerId = $this->generateControllerId($name, $actionName); |
123 | 123 | $this->container->setDefinition($controllerId, $definition); |
124 | 124 | |
125 | - $action = $controllerId . ':' . CreateController::ACTION; |
|
125 | + $action = $controllerId.':'.CreateController::ACTION; |
|
126 | 126 | $this->registerRoute( |
127 | 127 | $mount, |
128 | 128 | $name, |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | private function generateControllerId($name, $actionName) |
152 | 152 | { |
153 | - return $this->normalize('cruds.generated_controller.' . $name . '.' . $actionName); |
|
153 | + return $this->normalize('cruds.generated_controller.'.$name.'.'.$actionName); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | 'addRoute', |
182 | 182 | [ |
183 | 183 | $mount, |
184 | - $this->normalize('cruds.routing.' . $name . '.' . $actionName), |
|
184 | + $this->normalize('cruds.routing.'.$name.'.'.$actionName), |
|
185 | 185 | $path, |
186 | 186 | $action, |
187 | 187 | $methods, |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $controllerId = $this->generateControllerId($name, $actionName); |
216 | 216 | $this->container->setDefinition($controllerId, $definition); |
217 | 217 | |
218 | - $action = $controllerId . ':' . ReadController::ACTION; |
|
218 | + $action = $controllerId.':'.ReadController::ACTION; |
|
219 | 219 | $this->registerRoute( |
220 | 220 | $mount, |
221 | 221 | $name, |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $controllerId = $this->generateControllerId($name, $actionName); |
250 | 250 | $this->container->setDefinition($controllerId, $definition); |
251 | 251 | |
252 | - $action = $controllerId . ':' . UpdateController::ACTION; |
|
252 | + $action = $controllerId.':'.UpdateController::ACTION; |
|
253 | 253 | $this->registerRoute( |
254 | 254 | $mount, |
255 | 255 | $name, |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $controllerId = $controllerId = $this->generateControllerId($name, $actionName); |
277 | 277 | $this->container->setDefinition($controllerId, $definition); |
278 | 278 | |
279 | - $action = $controllerId . ':' . DeleteController::ACTION; |
|
279 | + $action = $controllerId.':'.DeleteController::ACTION; |
|
280 | 280 | $this->registerRoute( |
281 | 281 | $mount, |
282 | 282 | $name, |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $controllerId = $this->generateControllerId($name, $actionName); |
317 | 317 | $this->container->setDefinition($controllerId, $definition); |
318 | 318 | |
319 | - $action = $controllerId . ':' . SearchController::ACTION; |
|
319 | + $action = $controllerId.':'.SearchController::ACTION; |
|
320 | 320 | $this->registerRoute( |
321 | 321 | $mount, |
322 | 322 | $name, |
@@ -341,12 +341,12 @@ discard block |
||
341 | 341 | $controllerId = $this->generateControllerId($name, $actionName); |
342 | 342 | $this->container->setDefinition($controllerId, $definition); |
343 | 343 | |
344 | - $action = $controllerId . ':' . CountController::ACTION; |
|
344 | + $action = $controllerId.':'.CountController::ACTION; |
|
345 | 345 | $this->registerRoute( |
346 | 346 | $mount, |
347 | 347 | $name, |
348 | 348 | $actionName, |
349 | - $prefix . $count_path, |
|
349 | + $prefix.$count_path, |
|
350 | 350 | $action, |
351 | 351 | ['GET', 'POST'], |
352 | 352 | ['class' => $class, 'arguments' => ['criteria']] |
@@ -24,26 +24,26 @@ |
||
24 | 24 | |
25 | 25 | public function getCacheDir() |
26 | 26 | { |
27 | - return __DIR__ . '/../../../build/' . $this->getClassName() . '/cache'; |
|
27 | + return __DIR__.'/../../../build/'.$this->getClassName().'/cache'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function getLogDir() |
31 | 31 | { |
32 | - return __DIR__ . '/../../../build/' . $this->getClassName() . '/logs'; |
|
32 | + return __DIR__.'/../../../build/'.$this->getClassName().'/logs'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** {@inheritdoc} */ |
36 | 36 | public function registerContainerConfiguration(LoaderInterface $loader) |
37 | 37 | { |
38 | - return $loader->load(__DIR__ . '/config.yml'); |
|
38 | + return $loader->load(__DIR__.'/config.yml'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** {@inheritdoc} */ |
42 | 42 | protected function buildContainer() |
43 | 43 | { |
44 | 44 | $container = parent::buildContainer(); |
45 | - $container->addResource(new FileResource(__DIR__ . '/config.yml')); |
|
46 | - $container->addResource(new FileResource(__DIR__ . '/routing.yml')); |
|
45 | + $container->addResource(new FileResource(__DIR__.'/config.yml')); |
|
46 | + $container->addResource(new FileResource(__DIR__.'/routing.yml')); |
|
47 | 47 | |
48 | 48 | return $container; |
49 | 49 | } |
@@ -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 | } |
@@ -48,6 +48,9 @@ discard block |
||
48 | 48 | self::assertSame(3, $controller->countAction(['a' => [1, 2, 4]])); |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param integer $a |
|
53 | + */ |
|
51 | 54 | private function createFixture($a, $b, $c) |
52 | 55 | { |
53 | 56 | $entity = new AbcClass(); |
@@ -59,7 +62,7 @@ discard block |
||
59 | 62 | } |
60 | 63 | |
61 | 64 | /** |
62 | - * @return ReferenceProviderInterface|\PHPUnit_Framework_MockObject_MockObject |
|
65 | + * @return ReferenceProviderInterface |
|
63 | 66 | */ |
64 | 67 | private function getReferenceProvider() |
65 | 68 | { |
@@ -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 |
@@ -95,6 +95,9 @@ discard block |
||
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 |
||
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 | { |
@@ -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 | } |