@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $page = $paramFetcher->get('page'); |
| 51 | 51 | $limit = $paramFetcher->get('limit'); |
| 52 | 52 | /** @var AbstractPagination $paginationView */ |
| 53 | - $paginationView = $this->paginator->paginate($query, $page, $limit); |
|
| 53 | + $paginationView = $this->paginator->paginate($query, $page, $limit); |
|
| 54 | 54 | |
| 55 | 55 | return new RestPaginator( |
| 56 | 56 | $page, |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | { |
| 149 | 149 | $entityName = $dataclass; |
| 150 | 150 | |
| 151 | - $routeName = 'autocomplete_' . strtolower($entityName); |
|
| 151 | + $routeName = 'autocomplete_'.strtolower($entityName); |
|
| 152 | 152 | |
| 153 | 153 | return $this->router->getRouteCollection()->get($routeName) ? $this->router->generate($routeName) : null; |
| 154 | 154 | } |
@@ -39,9 +39,9 @@ |
||
| 39 | 39 | $current = ''; |
| 40 | 40 | $code = sprintf( |
| 41 | 41 | "%s:\n", |
| 42 | - Container::underscore(substr($bundle, 0, -6)) . ( |
|
| 42 | + Container::underscore(substr($bundle, 0, -6)).( |
|
| 43 | 43 | '/' !== $prefix |
| 44 | - ? '_' . str_replace('/', '_', substr($prefix, 1)) |
|
| 44 | + ? '_'.str_replace('/', '_', substr($prefix, 1)) |
|
| 45 | 45 | : '' |
| 46 | 46 | ) |
| 47 | 47 | ); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | )); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - return $collection->map(function ($entity) { |
|
| 60 | + return $collection->map(function($entity) { |
|
| 61 | 61 | try { |
| 62 | 62 | $entityString = (string) $entity; |
| 63 | 63 | } catch (\Exception $e) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | return $collection; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - return $collection->map(function ($id) { |
|
| 100 | + return $collection->map(function($id) { |
|
| 101 | 101 | $entity = $this->entityManager |
| 102 | 102 | ->getRepository($this->entityName) |
| 103 | 103 | ->find($id) |
@@ -38,8 +38,8 @@ |
||
| 38 | 38 | if ($resolver instanceof OptionsResolver) { |
| 39 | 39 | $resolver->setAllowedTypes('entityName', ['string']); |
| 40 | 40 | $resolver->setDefined(['entityName']); |
| 41 | - $resolver->setDefault('invalid_message', function (Options $options) { |
|
| 42 | - return 'This value is not valid. Unable to find ' . $options['entityName'] . ' in the database.'; |
|
| 41 | + $resolver->setDefault('invalid_message', function(Options $options) { |
|
| 42 | + return 'This value is not valid. Unable to find '.$options['entityName'].' in the database.'; |
|
| 43 | 43 | }); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | if (!$this->canWriteToFile($forceOverwrite)) { |
| 34 | 34 | throw new \RuntimeException(sprintf( |
| 35 | 35 | 'Unable to generate the %s manager class as it already exists under the file: %s', |
| 36 | - $this->helper->getEntityClass() . 'Type', |
|
| 36 | + $this->helper->getEntityClass().'Type', |
|
| 37 | 37 | $this->helper->getManagerFullFilename() |
| 38 | 38 | )); |
| 39 | 39 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $this->renderFile( |
| 52 | 52 | 'manager/interface.php.twig', |
| 53 | - $this->helper->getManagerFullFilename($this->helper->getManagerClass() . 'Interface.php'), |
|
| 53 | + $this->helper->getManagerFullFilename($this->helper->getManagerClass().'Interface.php'), |
|
| 54 | 54 | [ |
| 55 | 55 | 'bundle_namespace' => $this->helper->getBundleNamespace(), |
| 56 | 56 | 'entity_class' => $this->helper->getEntityClass(), |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function generate(ClassMetadataInfo $metadata, $forceOverwrite = false) |
| 43 | 43 | { |
| 44 | - $file = $this->helper->getResourcesDirname() . '/config/serializer/Entity.' . $this->helper->getEntityClass() . '.yml'; |
|
| 44 | + $file = $this->helper->getResourcesDirname().'/config/serializer/Entity.'.$this->helper->getEntityClass().'.yml'; |
|
| 45 | 45 | |
| 46 | 46 | if (!file_exists(dirname($file)) && !@mkdir(dirname($file), 0777, true)) { |
| 47 | 47 | throw new IOException('Unable to create config/serializer directory'); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | $targetClassName = basename($targetClass); |
| 95 | 95 | |
| 96 | - $targetPath = $dirPath . '/Entity.' . $targetClassName . '.yml'; |
|
| 96 | + $targetPath = $dirPath.'/Entity.'.$targetClassName.'.yml'; |
|
| 97 | 97 | $targetData = $this->getYamlFileContent($targetPath); |
| 98 | 98 | |
| 99 | 99 | if (isset($targetData[$targetClass])) { |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | $groups = []; |
| 180 | 180 | foreach ($this->excludedRelationPrefixSuffixPairs as $pair) { |
| 181 | - $groups[] = $pair[0] . $entityName . $pair[1]; |
|
| 181 | + $groups[] = $pair[0].$entityName.$pair[1]; |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | $result[] = [ |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | */ |
| 114 | 114 | protected function generateTestClass() |
| 115 | 115 | { |
| 116 | - $target = $this->helper->getTestsDirname() . '/Controller/' . $this->helper->getControllerClass() . 'Test.php'; |
|
| 116 | + $target = $this->helper->getTestsDirname().'/Controller/'.$this->helper->getControllerClass().'Test.php'; |
|
| 117 | 117 | |
| 118 | 118 | $this->renderFile('controller/controller-test.php.twig', $target, array( |
| 119 | 119 | 'entity' => $this->entity, |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | public function __construct(BundleInterface $bundle, $entity, ClassMetadataInfo $metadata) |
| 24 | 24 | { |
| 25 | 25 | if (count($metadata->getIdentifier()) > 1) { |
| 26 | - throw new \RuntimeException(__CLASS__ . ' does not support entity classes with multiple primary keys.'); |
|
| 26 | + throw new \RuntimeException(__CLASS__.' does not support entity classes with multiple primary keys.'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $this->entityClass = $this->prepareEntityClass($entity); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if (!$this->canWriteToFile($formPath, $forceOverwrite)) { |
| 51 | 51 | throw new \RuntimeException(sprintf( |
| 52 | 52 | 'Unable to generate the %s form class as it already exists under the file: %s', |
| 53 | - $this->entityClass . 'Type', |
|
| 53 | + $this->entityClass.'Type', |
|
| 54 | 54 | $formPath |
| 55 | 55 | )); |
| 56 | 56 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | 'entity_class' => $this->entityClass, |
| 80 | 80 | 'rest_support' => true, |
| 81 | 81 | 'rest_form_type_name' => $this->prepareFormAlias($this->entityClass), |
| 82 | - 'form_type_name' => $this->prepareFormTypeName($this->entity, $this->namespace, $this->entityClass) . 'filter' |
|
| 82 | + 'form_type_name' => $this->prepareFormTypeName($this->entity, $this->namespace, $this->entityClass).'filter' |
|
| 83 | 83 | ] |
| 84 | 84 | ); |
| 85 | 85 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | protected function prepareFormAlias($entityClass) |
| 100 | 100 | { |
| 101 | - return ltrim(preg_replace_callback('|[A-Z]+|', function ($data) { |
|
| 101 | + return ltrim(preg_replace_callback('|[A-Z]+|', function($data) { |
|
| 102 | 102 | return '_'.strtolower($data[0]); |
| 103 | 103 | }, $entityClass), '_'); |
| 104 | 104 | } |
@@ -110,13 +110,13 @@ discard block |
||
| 110 | 110 | str_replace('\\', '_', $namespace) |
| 111 | 111 | . ($parts ? '_' : '') |
| 112 | 112 | . implode('_', $parts) |
| 113 | - . '_' . $entityClass |
|
| 113 | + . '_'.$entityClass |
|
| 114 | 114 | ); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | protected function prepareFilePath($path, $postfix) |
| 118 | 118 | { |
| 119 | - return $this->bundlePath . $path . str_replace('\\', '/', $this->entity) . $postfix . '.php'; |
|
| 119 | + return $this->bundlePath.$path.str_replace('\\', '/', $this->entity).$postfix.'.php'; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |