@@ -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 | } |
@@ -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 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 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 | /** |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | /** {@inheritdoc} */ |
| 44 | 44 | public function registerContainerConfiguration(LoaderInterface $loader) |
| 45 | 45 | { |
| 46 | - return $loader->load(__DIR__ . '/config.yml'); |
|
| 46 | + return $loader->load(__DIR__.'/config.yml'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | protected function initializeContainer() |
| 50 | 50 | { |
| 51 | 51 | $class = $this->getContainerClass(); |
| 52 | - $cache = new ConfigCache($this->getCacheDir() . '/' . $class . '.php', $this->debug); |
|
| 52 | + $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug); |
|
| 53 | 53 | |
| 54 | 54 | $container = $this->buildContainer(); |
| 55 | 55 | $container->compile(); |
@@ -60,15 +60,15 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | public function getCacheDir() |
| 62 | 62 | { |
| 63 | - return __DIR__ . '/../../../build/' . $this->getClassName() . '/cache'; |
|
| 63 | + return __DIR__.'/../../../build/'.$this->getClassName().'/cache'; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** {@inheritdoc} */ |
| 67 | 67 | protected function buildContainer() |
| 68 | 68 | { |
| 69 | 69 | $container = parent::buildContainer(); |
| 70 | - $container->addResource(new FileResource(__DIR__ . '/config.yml')); |
|
| 71 | - $container->addResource(new FileResource(__DIR__ . '/routing.yml')); |
|
| 70 | + $container->addResource(new FileResource(__DIR__.'/config.yml')); |
|
| 71 | + $container->addResource(new FileResource(__DIR__.'/routing.yml')); |
|
| 72 | 72 | |
| 73 | 73 | return $container; |
| 74 | 74 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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, |