@@ -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, |
@@ -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) |
@@ -35,8 +35,8 @@ |
||
| 35 | 35 | if ($resolver instanceof OptionsResolver) { |
| 36 | 36 | $resolver->setAllowedTypes('entityName', ['string']); |
| 37 | 37 | $resolver->setDefined(['entityName']); |
| 38 | - $resolver->setDefault('invalid_message', function (Options $options) { |
|
| 39 | - return 'This value is not valid. Unable to find ' . $options['entityName'] . ' in the database.'; |
|
| 38 | + $resolver->setDefault('invalid_message', function(Options $options) { |
|
| 39 | + return 'This value is not valid. Unable to find '.$options['entityName'].' in the database.'; |
|
| 40 | 40 | }); |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -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 | } |
@@ -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 | /** |
@@ -23,14 +23,14 @@ discard block |
||
| 23 | 23 | $matches = []; |
| 24 | 24 | preg_match('/^get([A-Z][a-z]+)((Full)?[A-Z][a-z]+)$/', $name, $matches); |
| 25 | 25 | if (empty($matches)) { |
| 26 | - throw new \Exception('Unsupported method: ' . $name); |
|
| 26 | + throw new \Exception('Unsupported method: '.$name); |
|
| 27 | 27 | } |
| 28 | 28 | $category = $matches[1]; |
| 29 | 29 | $type = $matches[2]; |
| 30 | 30 | |
| 31 | - $method = 'get' . $type; |
|
| 31 | + $method = 'get'.$type; |
|
| 32 | 32 | if (!method_exists($this, $method)) { |
| 33 | - throw new \Exception('Unsupported method: ' . $name); |
|
| 33 | + throw new \Exception('Unsupported method: '.$name); |
|
| 34 | 34 | } |
| 35 | 35 | return $this->$method($category, $args); |
| 36 | 36 | } |
@@ -42,33 +42,33 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | protected function getFullClass($category, $args) |
| 44 | 44 | { |
| 45 | - return $this->getNamespace($category, $args) . '\\' . $this->entityClass . $this->getClassSuffix($category); |
|
| 45 | + return $this->getNamespace($category, $args).'\\'.$this->entityClass.$this->getClassSuffix($category); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | protected function getClass($category) |
| 49 | 49 | { |
| 50 | - return basename($this->entityClass . $this->getClassSuffix($category)); |
|
| 50 | + return basename($this->entityClass.$this->getClassSuffix($category)); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | protected function getNamespace($category) |
| 54 | 54 | { |
| 55 | - return $this->bundleNamespace . '\\' . $category; |
|
| 55 | + return $this->bundleNamespace.'\\'.$category; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | protected function getFullFilename($category, $args) |
| 59 | 59 | { |
| 60 | - $filename = isset($args[0]) ? $args[0] : (str_replace('\\', '/', $this->entityClass) . $this->getClassSuffix($category) . '.php'); |
|
| 61 | - return $this->getDirname($category, $args) . '/' . $filename; |
|
| 60 | + $filename = isset($args[0]) ? $args[0] : (str_replace('\\', '/', $this->entityClass).$this->getClassSuffix($category).'.php'); |
|
| 61 | + return $this->getDirname($category, $args).'/'.$filename; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | protected function getFilename($category, $args) |
| 65 | 65 | { |
| 66 | - return basename(isset($args[0]) ? $args[0] : (str_replace('\\', '/', $this->entityClass) . $this->getClassSuffix($category) . '.php')); |
|
| 66 | + return basename(isset($args[0]) ? $args[0] : (str_replace('\\', '/', $this->entityClass).$this->getClassSuffix($category).'.php')); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | protected function getDirname($category) |
| 70 | 70 | { |
| 71 | - return $this->bundleRoot . '/' . $category; |
|
| 71 | + return $this->bundleRoot.'/'.$category; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function camelToUnderscore($string) |