@@ -43,8 +43,8 @@ |
||
| 43 | 43 | $declaration = $this->createDeclaration(ConfigDeclaration::class); |
| 44 | 44 | |
| 45 | 45 | $declaration->create( |
| 46 | - (bool) $this->option('reverse'), |
|
| 47 | - (string) $this->argument('name') |
|
| 46 | + (bool)$this->option('reverse'), |
|
| 47 | + (string)$this->argument('name') |
|
| 48 | 48 | ); |
| 49 | 49 | |
| 50 | 50 | $this->writeDeclaration($declaration); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | protected FilesInterface $files, |
| 20 | 20 | ContainerInterface $container, |
| 21 | 21 | private readonly FactoryInterface $factory |
| 22 | - ) { |
|
| 22 | + ){ |
|
| 23 | 23 | $this->setContainer($container); |
| 24 | 24 | |
| 25 | 25 | parent::__construct(); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | return $this->factory->make( |
| 37 | 37 | $class, |
| 38 | 38 | [ |
| 39 | - 'name' => (string) $this->argument('name'), |
|
| 39 | + 'name' => (string)$this->argument('name'), |
|
| 40 | 40 | 'comment' => $this->option('comment'), |
| 41 | 41 | ] + $this->config->declarationOptions($class::TYPE) |
| 42 | 42 | ); |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | protected function writeDeclaration(DeclarationInterface $declaration): void |
| 49 | 49 | { |
| 50 | - $filename = $this->config->classFilename($declaration::TYPE, (string) $this->argument('name')); |
|
| 50 | + $filename = $this->config->classFilename($declaration::TYPE, (string)$this->argument('name')); |
|
| 51 | 51 | $filename = $this->files->normalizePath($filename); |
| 52 | 52 | $className = $declaration->getClass()->getName(); |
| 53 | 53 | |
| 54 | - if ($this->files->exists($filename)) { |
|
| 54 | + if ($this->files->exists($filename)){ |
|
| 55 | 55 | $this->writeln( |
| 56 | 56 | \sprintf("<fg=red>Unable to create '<comment>%s</comment>' declaration, ", $className) |
| 57 | 57 | . \sprintf("file '<comment>%s</comment>' already exists.</fg=red>", $filename) |
@@ -51,7 +51,8 @@ |
||
| 51 | 51 | $filename = $this->files->normalizePath($filename); |
| 52 | 52 | $className = $declaration->getClass()->getName(); |
| 53 | 53 | |
| 54 | - if ($this->files->exists($filename)) { |
|
| 54 | + if ($this->files->exists($filename)) |
|
| 55 | + { |
|
| 55 | 56 | $this->writeln( |
| 56 | 57 | \sprintf("<fg=red>Unable to create '<comment>%s</comment>' declaration, ", $className) |
| 57 | 58 | . \sprintf("file '<comment>%s</comment>' already exists.</fg=red>", $filename) |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ['name', InputArgument::REQUIRED, 'Command name'], |
| 17 | 17 | ['alias', InputArgument::OPTIONAL, 'Command id/alias'], |
| 18 | 18 | ]; |
| 19 | - protected const OPTIONS = [ |
|
| 19 | + protected const OPTIONS = [ |
|
| 20 | 20 | [ |
| 21 | 21 | 'description', |
| 22 | 22 | 'd', |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $declaration = $this->createDeclaration(CommandDeclaration::class); |
| 40 | 40 | |
| 41 | - $declaration->setAlias((string) ($this->argument('alias') ?? $this->argument('name'))); |
|
| 42 | - $declaration->setDescription((string) $this->option('description')); |
|
| 41 | + $declaration->setAlias((string)($this->argument('alias') ?? $this->argument('name'))); |
|
| 42 | + $declaration->setDescription((string)$this->option('description')); |
|
| 43 | 43 | |
| 44 | 44 | $this->writeDeclaration($declaration); |
| 45 | 45 | |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $declaration = $this->createDeclaration(ControllerDeclaration::class); |
| 45 | 45 | |
| 46 | - foreach ($this->option('action') as $action) { |
|
| 46 | + foreach ($this->option('action') as $action){ |
|
| 47 | 47 | $declaration->addAction($action); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if ((bool)$this->option('prototype')) { |
|
| 50 | + if ((bool)$this->option('prototype')){ |
|
| 51 | 51 | $declaration->addPrototypeTrait(); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -43,11 +43,13 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $declaration = $this->createDeclaration(ControllerDeclaration::class); |
| 45 | 45 | |
| 46 | - foreach ($this->option('action') as $action) { |
|
| 46 | + foreach ($this->option('action') as $action) |
|
| 47 | + { |
|
| 47 | 48 | $declaration->addAction($action); |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | - if ((bool)$this->option('prototype')) { |
|
| 51 | + if ((bool)$this->option('prototype')) |
|
| 52 | + { |
|
| 51 | 53 | $declaration->addPrototypeTrait(); |
| 52 | 54 | } |
| 53 | 55 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | public function __construct( |
| 27 | 27 | private readonly ConfiguratorInterface $config, |
| 28 | 28 | private readonly KernelInterface $kernel |
| 29 | - ) { |
|
| 29 | + ){ |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function init(ConsoleBootloader $console): void |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | $console->addCommand(Command\JobHandlerCommand::class); |
| 39 | 39 | $console->addCommand(Command\MiddlewareCommand::class); |
| 40 | 40 | |
| 41 | - try { |
|
| 41 | + try{ |
|
| 42 | 42 | $defaultNamespace = (new ReflectionClass($this->kernel))->getNamespaceName(); |
| 43 | - } catch (ReflectionException) { |
|
| 43 | + }catch (ReflectionException){ |
|
| 44 | 44 | $defaultNamespace = ''; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * Base directory for generated classes, class will be automatically localed into sub directory |
| 56 | 56 | * using given namespace. |
| 57 | 57 | */ |
| 58 | - 'directory' => directory('app') . 'src/', |
|
| 58 | + 'directory' => directory('app').'src/', |
|
| 59 | 59 | |
| 60 | 60 | /* |
| 61 | 61 | * Default namespace to be applied for every generated class. By default uses Kernel namespace |
@@ -38,9 +38,12 @@ |
||
| 38 | 38 | $console->addCommand(Command\JobHandlerCommand::class); |
| 39 | 39 | $console->addCommand(Command\MiddlewareCommand::class); |
| 40 | 40 | |
| 41 | - try { |
|
| 41 | + try |
|
| 42 | + { |
|
| 42 | 43 | $defaultNamespace = (new ReflectionClass($this->kernel))->getNamespaceName(); |
| 43 | - } catch (ReflectionException) { |
|
| 44 | + } |
|
| 45 | + catch (ReflectionException) |
|
| 46 | + { |
|
| 44 | 47 | $defaultNamespace = ''; |
| 45 | 48 | } |
| 46 | 49 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | public function get(array $values): array |
| 27 | 27 | { |
| 28 | 28 | $output = []; |
| 29 | - foreach ($values as $key => $value) { |
|
| 29 | + foreach ($values as $key => $value){ |
|
| 30 | 30 | $output[$key] = self::TYPE_DEFAULTS[\gettype($value)] ?? null; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -26,7 +26,8 @@ |
||
| 26 | 26 | public function get(array $values): array |
| 27 | 27 | { |
| 28 | 28 | $output = []; |
| 29 | - foreach ($values as $key => $value) { |
|
| 29 | + foreach ($values as $key => $value) |
|
| 30 | + { |
|
| 30 | 31 | $output[$key] = self::TYPE_DEFAULTS[\gettype($value)] ?? null; |
| 31 | 32 | } |
| 32 | 33 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function getAnnotation(mixed $value): string |
| 28 | 28 | { |
| 29 | - if (\is_array($value)) { |
|
| 29 | + if (\is_array($value)){ |
|
| 30 | 30 | return $this->arrayAnnotationString($value); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | private function arrayAnnotationString(array $value): string |
| 42 | 42 | { |
| 43 | 43 | $types = []; |
| 44 | - foreach ($value as $item) { |
|
| 44 | + foreach ($value as $item){ |
|
| 45 | 45 | $types[] = \gettype($item); |
| 46 | 46 | } |
| 47 | 47 | $types = \array_unique($types); |
@@ -26,7 +26,8 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function getAnnotation(mixed $value): string |
| 28 | 28 | { |
| 29 | - if (\is_array($value)) { |
|
| 29 | + if (\is_array($value)) |
|
| 30 | + { |
|
| 30 | 31 | return $this->arrayAnnotationString($value); |
| 31 | 32 | } |
| 32 | 33 | |
@@ -41,7 +42,8 @@ discard block |
||
| 41 | 42 | private function arrayAnnotationString(array $value): string |
| 42 | 43 | { |
| 43 | 44 | $types = []; |
| 44 | - foreach ($value as $item) { |
|
| 45 | + foreach ($value as $item) |
|
| 46 | + { |
|
| 45 | 47 | $types[] = \gettype($item); |
| 46 | 48 | } |
| 47 | 49 | $types = \array_unique($types); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | protected readonly ScaffolderConfig $config, |
| 20 | 20 | string $name, |
| 21 | 21 | ?string $comment = null |
| 22 | - ) { |
|
| 22 | + ){ |
|
| 23 | 23 | $this->namespace = new PhpNamespace($this->config->classNamespace(static::TYPE, $name)); |
| 24 | 24 | |
| 25 | 25 | $this->class = $this->namespace |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | string $name, |
| 33 | 33 | ?string $comment = null, |
| 34 | 34 | private readonly string $directory = '' |
| 35 | - ) { |
|
| 35 | + ){ |
|
| 36 | 36 | parent::__construct($config, $name, $comment); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | $this->class->addConstant('CONFIG', $configName)->setPublic(); |
| 42 | 42 | |
| 43 | 43 | $filename = $this->makeConfigFilename($configName); |
| 44 | - if ($reverse) { |
|
| 45 | - if (!$this->files->exists($filename)) { |
|
| 44 | + if ($reverse){ |
|
| 45 | + if (!$this->files->exists($filename)){ |
|
| 46 | 46 | throw new ScaffolderException(\sprintf("Config filename %s doesn't exist", $filename)); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | $this->declareGetters($defaultsFromFile); |
| 51 | 51 | |
| 52 | 52 | $this->class->getProperty('config')->setValue($this->defaultValues->get($defaultsFromFile)); |
| 53 | - } else { |
|
| 54 | - if (!$this->files->exists($filename)) { |
|
| 53 | + }else{ |
|
| 54 | + if (!$this->files->exists($filename)){ |
|
| 55 | 55 | $this->touchConfigFile($filename); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $this->files->write( |
| 90 | 90 | $filename, |
| 91 | - $file->render() . PHP_EOL . (new Dumper())->dump(new Literal('return [];')), |
|
| 91 | + $file->render().PHP_EOL.(new Dumper())->dump(new Literal('return [];')), |
|
| 92 | 92 | FilesInterface::READONLY, |
| 93 | 93 | true |
| 94 | 94 | ); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $getters = []; |
| 111 | 111 | $gettersByKey = []; |
| 112 | 112 | |
| 113 | - foreach ($defaults as $key => $value) { |
|
| 113 | + foreach ($defaults as $key => $value){ |
|
| 114 | 114 | $key = (string)$key; |
| 115 | 115 | $getter = $this->makeGetterName($key); |
| 116 | 116 | $getters[] = $getter; |
@@ -119,19 +119,19 @@ discard block |
||
| 119 | 119 | $method->setBody(\sprintf('return $this->config[\'%s\'];', $key)); |
| 120 | 120 | $method->setComment(\sprintf('@return %s', $this->typeAnnotations->getAnnotation($value))); |
| 121 | 121 | |
| 122 | - if (\is_array($value)) { |
|
| 122 | + if (\is_array($value)){ |
|
| 123 | 123 | $gettersByKey[] = ['key' => $key, 'value' => $value]; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | $returnTypeHint = $this->typeHints->getHint(\gettype($value)); |
| 127 | - if ($returnTypeHint !== null) { |
|
| 127 | + if ($returnTypeHint !== null){ |
|
| 128 | 128 | $method->setReturnType($returnTypeHint); |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - foreach ($gettersByKey as $item) { |
|
| 132 | + foreach ($gettersByKey as $item){ |
|
| 133 | 133 | $method = $this->declareGettersByKey($getters, $item['key'], $item['value']); |
| 134 | - if ($method !== null) { |
|
| 134 | + if ($method !== null){ |
|
| 135 | 135 | $getters[] = $method->getName(); |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -142,30 +142,30 @@ discard block |
||
| 142 | 142 | private function declareGettersByKey(array $methodNames, string $key, array $value): ?Method |
| 143 | 143 | { |
| 144 | 144 | //Won't create if there's less than 2 sub-items |
| 145 | - if (\count($value) < 2) { |
|
| 145 | + if (\count($value) < 2){ |
|
| 146 | 146 | return null; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | $singularKey = $this->singularize($key); |
| 150 | 150 | $name = $this->makeGetterName($singularKey); |
| 151 | - if (\in_array($name, $methodNames, true)) { |
|
| 151 | + if (\in_array($name, $methodNames, true)){ |
|
| 152 | 152 | $name = $this->makeGetterName($singularKey, 'get', 'by'); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | //Name conflict, won't merge |
| 156 | - if (\in_array($name, $methodNames, true)) { |
|
| 156 | + if (\in_array($name, $methodNames, true)){ |
|
| 157 | 157 | return null; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $keyType = defineArrayType(\array_keys($value), '-mixed-'); |
| 161 | 161 | $valueType = defineArrayType(\array_values($value), '-mixed-'); |
| 162 | 162 | //We need a fixed structure here |
| 163 | - if ($keyType === '-mixed-' || $valueType === '-mixed-') { |
|
| 163 | + if ($keyType === '-mixed-' || $valueType === '-mixed-'){ |
|
| 164 | 164 | return null; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | //Won't create for associated arrays |
| 168 | - if ($this->typeAnnotations->mapType($keyType) === 'int' && !isAssociativeArray($value)) { |
|
| 168 | + if ($this->typeAnnotations->mapType($keyType) === 'int' && !isAssociativeArray($value)){ |
|
| 169 | 169 | return null; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | $param = $method->addParameter($singularKey); |
| 181 | 181 | $paramTypeHint = $this->typeHints->getHint($keyType); |
| 182 | - if ($paramTypeHint !== null) { |
|
| 182 | + if ($paramTypeHint !== null){ |
|
| 183 | 183 | $param->setType($paramTypeHint); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -189,13 +189,13 @@ discard block |
||
| 189 | 189 | private function makeGetterName(string $name, string $prefix = 'get', string $postfix = ''): string |
| 190 | 190 | { |
| 191 | 191 | $chunks = []; |
| 192 | - if (!empty($prefix)) { |
|
| 192 | + if (!empty($prefix)){ |
|
| 193 | 193 | $chunks[] = $prefix; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | $name = $this->slugify->slugify($name, ['lowercase' => false]); |
| 197 | 197 | $chunks[] = \count($chunks) !== 0 ? $this->classify($name) : $name; |
| 198 | - if (!empty($postfix)) { |
|
| 198 | + if (!empty($postfix)){ |
|
| 199 | 199 | $chunks[] = \ucfirst($postfix); |
| 200 | 200 | } |
| 201 | 201 | |
@@ -204,14 +204,14 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | private function classify(string $name): string |
| 206 | 206 | { |
| 207 | - return ( new InflectorFactory() ) |
|
| 207 | + return (new InflectorFactory()) |
|
| 208 | 208 | ->build() |
| 209 | 209 | ->classify($name); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | private function singularize(string $name): string |
| 213 | 213 | { |
| 214 | - return ( new InflectorFactory() ) |
|
| 214 | + return (new InflectorFactory()) |
|
| 215 | 215 | ->build() |
| 216 | 216 | ->singularize($name); |
| 217 | 217 | } |
@@ -41,8 +41,10 @@ discard block |
||
| 41 | 41 | $this->class->addConstant('CONFIG', $configName)->setPublic(); |
| 42 | 42 | |
| 43 | 43 | $filename = $this->makeConfigFilename($configName); |
| 44 | - if ($reverse) { |
|
| 45 | - if (!$this->files->exists($filename)) { |
|
| 44 | + if ($reverse) |
|
| 45 | + { |
|
| 46 | + if (!$this->files->exists($filename)) |
|
| 47 | + { |
|
| 46 | 48 | throw new ScaffolderException(\sprintf("Config filename %s doesn't exist", $filename)); |
| 47 | 49 | } |
| 48 | 50 | |
@@ -50,8 +52,11 @@ discard block |
||
| 50 | 52 | $this->declareGetters($defaultsFromFile); |
| 51 | 53 | |
| 52 | 54 | $this->class->getProperty('config')->setValue($this->defaultValues->get($defaultsFromFile)); |
| 53 | - } else { |
|
| 54 | - if (!$this->files->exists($filename)) { |
|
| 55 | + } |
|
| 56 | + else |
|
| 57 | + { |
|
| 58 | + if (!$this->files->exists($filename)) |
|
| 59 | + { |
|
| 55 | 60 | $this->touchConfigFile($filename); |
| 56 | 61 | } |
| 57 | 62 | } |
@@ -110,7 +115,8 @@ discard block |
||
| 110 | 115 | $getters = []; |
| 111 | 116 | $gettersByKey = []; |
| 112 | 117 | |
| 113 | - foreach ($defaults as $key => $value) { |
|
| 118 | + foreach ($defaults as $key => $value) |
|
| 119 | + { |
|
| 114 | 120 | $key = (string)$key; |
| 115 | 121 | $getter = $this->makeGetterName($key); |
| 116 | 122 | $getters[] = $getter; |
@@ -119,19 +125,23 @@ discard block |
||
| 119 | 125 | $method->setBody(\sprintf('return $this->config[\'%s\'];', $key)); |
| 120 | 126 | $method->setComment(\sprintf('@return %s', $this->typeAnnotations->getAnnotation($value))); |
| 121 | 127 | |
| 122 | - if (\is_array($value)) { |
|
| 128 | + if (\is_array($value)) |
|
| 129 | + { |
|
| 123 | 130 | $gettersByKey[] = ['key' => $key, 'value' => $value]; |
| 124 | 131 | } |
| 125 | 132 | |
| 126 | 133 | $returnTypeHint = $this->typeHints->getHint(\gettype($value)); |
| 127 | - if ($returnTypeHint !== null) { |
|
| 134 | + if ($returnTypeHint !== null) |
|
| 135 | + { |
|
| 128 | 136 | $method->setReturnType($returnTypeHint); |
| 129 | 137 | } |
| 130 | 138 | } |
| 131 | 139 | |
| 132 | - foreach ($gettersByKey as $item) { |
|
| 140 | + foreach ($gettersByKey as $item) |
|
| 141 | + { |
|
| 133 | 142 | $method = $this->declareGettersByKey($getters, $item['key'], $item['value']); |
| 134 | - if ($method !== null) { |
|
| 143 | + if ($method !== null) |
|
| 144 | + { |
|
| 135 | 145 | $getters[] = $method->getName(); |
| 136 | 146 | } |
| 137 | 147 | } |
@@ -142,30 +152,35 @@ discard block |
||
| 142 | 152 | private function declareGettersByKey(array $methodNames, string $key, array $value): ?Method |
| 143 | 153 | { |
| 144 | 154 | //Won't create if there's less than 2 sub-items |
| 145 | - if (\count($value) < 2) { |
|
| 155 | + if (\count($value) < 2) |
|
| 156 | + { |
|
| 146 | 157 | return null; |
| 147 | 158 | } |
| 148 | 159 | |
| 149 | 160 | $singularKey = $this->singularize($key); |
| 150 | 161 | $name = $this->makeGetterName($singularKey); |
| 151 | - if (\in_array($name, $methodNames, true)) { |
|
| 162 | + if (\in_array($name, $methodNames, true)) |
|
| 163 | + { |
|
| 152 | 164 | $name = $this->makeGetterName($singularKey, 'get', 'by'); |
| 153 | 165 | } |
| 154 | 166 | |
| 155 | 167 | //Name conflict, won't merge |
| 156 | - if (\in_array($name, $methodNames, true)) { |
|
| 168 | + if (\in_array($name, $methodNames, true)) |
|
| 169 | + { |
|
| 157 | 170 | return null; |
| 158 | 171 | } |
| 159 | 172 | |
| 160 | 173 | $keyType = defineArrayType(\array_keys($value), '-mixed-'); |
| 161 | 174 | $valueType = defineArrayType(\array_values($value), '-mixed-'); |
| 162 | 175 | //We need a fixed structure here |
| 163 | - if ($keyType === '-mixed-' || $valueType === '-mixed-') { |
|
| 176 | + if ($keyType === '-mixed-' || $valueType === '-mixed-') |
|
| 177 | + { |
|
| 164 | 178 | return null; |
| 165 | 179 | } |
| 166 | 180 | |
| 167 | 181 | //Won't create for associated arrays |
| 168 | - if ($this->typeAnnotations->mapType($keyType) === 'int' && !isAssociativeArray($value)) { |
|
| 182 | + if ($this->typeAnnotations->mapType($keyType) === 'int' && !isAssociativeArray($value)) |
|
| 183 | + { |
|
| 169 | 184 | return null; |
| 170 | 185 | } |
| 171 | 186 | |
@@ -179,7 +194,8 @@ discard block |
||
| 179 | 194 | |
| 180 | 195 | $param = $method->addParameter($singularKey); |
| 181 | 196 | $paramTypeHint = $this->typeHints->getHint($keyType); |
| 182 | - if ($paramTypeHint !== null) { |
|
| 197 | + if ($paramTypeHint !== null) |
|
| 198 | + { |
|
| 183 | 199 | $param->setType($paramTypeHint); |
| 184 | 200 | } |
| 185 | 201 | |
@@ -189,13 +205,15 @@ discard block |
||
| 189 | 205 | private function makeGetterName(string $name, string $prefix = 'get', string $postfix = ''): string |
| 190 | 206 | { |
| 191 | 207 | $chunks = []; |
| 192 | - if (!empty($prefix)) { |
|
| 208 | + if (!empty($prefix)) |
|
| 209 | + { |
|
| 193 | 210 | $chunks[] = $prefix; |
| 194 | 211 | } |
| 195 | 212 | |
| 196 | 213 | $name = $this->slugify->slugify($name, ['lowercase' => false]); |
| 197 | 214 | $chunks[] = \count($chunks) !== 0 ? $this->classify($name) : $name; |
| 198 | - if (!empty($postfix)) { |
|
| 215 | + if (!empty($postfix)) |
|
| 216 | + { |
|
| 199 | 217 | $chunks[] = \ucfirst($postfix); |
| 200 | 218 | } |
| 201 | 219 | |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | $this->files->write( |
| 90 | 90 | $filename, |
| 91 | 91 | $file->render() . PHP_EOL . (new Dumper())->dump(new Literal('return [];')), |
| 92 | - FilesInterface::READONLY, |
|
| 92 | + FilesInterface::readonly, |
|
| 93 | 93 | true |
| 94 | 94 | ); |
| 95 | 95 | } |