@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * FormProcessor constructor. |
| 21 | 21 | * |
| 22 | 22 | * @param FormFactoryInterface $factory |
| 23 | - * @param string|FormTypeInterface $form |
|
| 23 | + * @param \Symfony\Component\Form\FormInterface $form |
|
| 24 | 24 | * @param array $options |
| 25 | 25 | */ |
| 26 | 26 | public function __construct(FormFactoryInterface $factory, $form, array $options = []) |
@@ -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) |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * @param $className |
|
| 31 | + * @param string $className |
|
| 32 | 32 | * |
| 33 | 33 | * @return FormInterface |
| 34 | 34 | * |
@@ -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 |
@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | $actionConfig['class'] = $class; |
| 60 | 60 | $actionConfig['mount'] = $mount; |
| 61 | 61 | $actionConfig['repository'] = $repositoryDefinition; |
| 62 | - $actionConfig['path'] = $prefix . $actionConfig['path']; |
|
| 62 | + $actionConfig['path'] = $prefix.$actionConfig['path']; |
|
| 63 | 63 | $actionConfig['manager'] = $manager; |
| 64 | - $function = new \ReflectionMethod($this, 'register' . ucfirst($action) . 'Action'); |
|
| 64 | + $function = new \ReflectionMethod($this, 'register'.ucfirst($action).'Action'); |
|
| 65 | 65 | $args = []; |
| 66 | 66 | |
| 67 | 67 | foreach ($function->getParameters() as $parameter) { |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $controllerId = $this->generateControllerId($name, $actionName); |
| 106 | 106 | $this->container->setDefinition($controllerId, $definition); |
| 107 | 107 | |
| 108 | - $action = $controllerId . ':' . CreateController::ACTION; |
|
| 108 | + $action = $controllerId.':'.CreateController::ACTION; |
|
| 109 | 109 | $this->registerRoute( |
| 110 | 110 | $mount, |
| 111 | 111 | $name, |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $controllerId = $this->generateControllerId($name, $actionName); |
| 132 | 132 | $this->container->setDefinition($controllerId, $definition); |
| 133 | 133 | |
| 134 | - $action = $controllerId . ':' . ReadController::ACTION; |
|
| 134 | + $action = $controllerId.':'.ReadController::ACTION; |
|
| 135 | 135 | $this->registerRoute( |
| 136 | 136 | $mount, |
| 137 | 137 | $name, |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $controllerId = $this->generateControllerId($name, $actionName); |
| 166 | 166 | $this->container->setDefinition($controllerId, $definition); |
| 167 | 167 | |
| 168 | - $action = $controllerId . ':' . UpdateController::ACTION; |
|
| 168 | + $action = $controllerId.':'.UpdateController::ACTION; |
|
| 169 | 169 | $this->registerRoute( |
| 170 | 170 | $mount, |
| 171 | 171 | $name, |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $controllerId = $controllerId = $this->generateControllerId($name, $actionName); |
| 193 | 193 | $this->container->setDefinition($controllerId, $definition); |
| 194 | 194 | |
| 195 | - $action = $controllerId . ':' . DeleteController::ACTION; |
|
| 195 | + $action = $controllerId.':'.DeleteController::ACTION; |
|
| 196 | 196 | $this->registerRoute( |
| 197 | 197 | $mount, |
| 198 | 198 | $name, |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $controllerId = $this->generateControllerId($name, $actionName); |
| 233 | 233 | $this->container->setDefinition($controllerId, $definition); |
| 234 | 234 | |
| 235 | - $action = $controllerId . ':' . SearchController::ACTION; |
|
| 235 | + $action = $controllerId.':'.SearchController::ACTION; |
|
| 236 | 236 | $this->registerRoute( |
| 237 | 237 | $mount, |
| 238 | 238 | $name, |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | 'addRoute', |
| 288 | 288 | [ |
| 289 | 289 | $mount, |
| 290 | - $this->normalize('cruds.routing.' . $name . '.' . $actionName), |
|
| 290 | + $this->normalize('cruds.routing.'.$name.'.'.$actionName), |
|
| 291 | 291 | $path, |
| 292 | 292 | $action, |
| 293 | 293 | $methods, |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | private function generateControllerId($name, $actionName) |
| 312 | 312 | { |
| 313 | - return $this->normalize('cruds.generated_controller.' . $name . '.' . $actionName); |
|
| 313 | + return $this->normalize('cruds.generated_controller.'.$name.'.'.$actionName); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
@@ -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 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | ->defaultValue('api') |
| 54 | 54 | ->cannotBeEmpty() |
| 55 | 55 | ->info( |
| 56 | - 'Route mount. You can create different entries ' . |
|
| 56 | + 'Route mount. You can create different entries '. |
|
| 57 | 57 | 'with different mounts. You can use this value when loading routes' |
| 58 | 58 | ) |
| 59 | 59 | ->example('my-mount-name'); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ->beforeNormalization() |
| 74 | 74 | ->ifArray() |
| 75 | 75 | ->then( |
| 76 | - function (array $v) { |
|
| 76 | + function(array $v) { |
|
| 77 | 77 | if (array_keys($v) !== range(0, count($v) - 1)) { |
| 78 | 78 | return $v; |
| 79 | 79 | } |
@@ -108,9 +108,9 @@ discard block |
||
| 108 | 108 | ->defaultNull() |
| 109 | 109 | ->example('@my_entity.factory') |
| 110 | 110 | ->info( |
| 111 | - 'Service ID implementing ' . PHP_EOL . |
|
| 112 | - EntityFactoryInterface::class . PHP_EOL . |
|
| 113 | - 'Defaults to ' . ReflectionConstructorFactory::class |
|
| 111 | + 'Service ID implementing '.PHP_EOL. |
|
| 112 | + EntityFactoryInterface::class.PHP_EOL. |
|
| 113 | + 'Defaults to '.ReflectionConstructorFactory::class |
|
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | 116 | $create |
@@ -119,9 +119,9 @@ discard block |
||
| 119 | 119 | ->defaultNull() |
| 120 | 120 | ->example('@my_entity.factory') |
| 121 | 121 | ->info( |
| 122 | - 'Service ID implementing ' . PHP_EOL . |
|
| 123 | - EntityFactoryInterface::class . PHP_EOL . |
|
| 124 | - 'Defaults to ' . ReflectionConstructorFactory::class |
|
| 122 | + 'Service ID implementing '.PHP_EOL. |
|
| 123 | + EntityFactoryInterface::class.PHP_EOL. |
|
| 124 | + 'Defaults to '.ReflectionConstructorFactory::class |
|
| 125 | 125 | ); |
| 126 | 126 | |
| 127 | 127 | $this->configureActionNode($create, 'create'); |
@@ -161,9 +161,9 @@ discard block |
||
| 161 | 161 | ->defaultNull() |
| 162 | 162 | ->example('@my_entity.processor') |
| 163 | 163 | ->info( |
| 164 | - 'Service ID implementing ' . PHP_EOL . |
|
| 165 | - EntityProcessorInterface::class . PHP_EOL . |
|
| 166 | - 'Defaults to ' . PropertyAccessProcessor::class |
|
| 164 | + 'Service ID implementing '.PHP_EOL. |
|
| 165 | + EntityProcessorInterface::class.PHP_EOL. |
|
| 166 | + 'Defaults to '.PropertyAccessProcessor::class |
|
| 167 | 167 | ); |
| 168 | 168 | |
| 169 | 169 | $this->configureActionNode($update, 'update'); |
@@ -185,6 +185,6 @@ discard block |
||
| 185 | 185 | ->children() |
| 186 | 186 | ->scalarNode('path') |
| 187 | 187 | ->info('Action path (will be prefixed with entity prefix)') |
| 188 | - ->defaultValue('/' . $action); |
|
| 188 | + ->defaultValue('/'.$action); |
|
| 189 | 189 | } |
| 190 | 190 | } |