@@ -36,7 +36,7 @@ |
||
| 36 | 36 | implode( |
| 37 | 37 | "\n\n", |
| 38 | 38 | array_map( |
| 39 | - function ($l) { |
|
| 39 | + function($l) { |
|
| 40 | 40 | return implode("\n\n", $l); |
| 41 | 41 | }, |
| 42 | 42 | $errors |
@@ -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']] |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | - * @return string[] |
|
| 74 | + * @return integer[] |
|
| 75 | 75 | */ |
| 76 | 76 | public function getMounts() |
| 77 | 77 | { |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | */ |
| 64 | 64 | public function getRoutes($mount) |
| 65 | 65 | { |
| 66 | - if (!array_key_exists($mount, $this->routes)){ |
|
| 66 | + if (!array_key_exists($mount, $this->routes)) { |
|
| 67 | 67 | throw new \OutOfBoundsException('Mount does not exist'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -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 | } |
@@ -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(); |
@@ -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 | } |