comparison src/Generator/Replacer.php @ 12:4bb4daa9e3f1 development

Working with the new FileModifier
author luka
date Wed, 24 Apr 2024 19:52:35 -0400
parents a20439b1c9d3
children
comparison
equal deleted inserted replaced
4:a20439b1c9d3 12:4bb4daa9e3f1
51 $target 51 $target
52 ); 52 );
53 53
54 return $target; 54 return $target;
55 } 55 }
56 56 /**
57 * @return array<string,mixed>
58 */
57 public function get_available_replacements() 59 public function get_available_replacements()
58 { 60 {
59 $table_name = $this->getTableInput(); 61 $table_name = $this->getTableInput();
60 $replacements = [ 62 $replacements = [
61 "{{ class }}" => $this->getClassName($table_name), 63 "{{ class }}" => $this->getClassName($table_name),
136 138
137 public function getRequestNamespace(string $name) 139 public function getRequestNamespace(string $name)
138 { 140 {
139 return $this->getRootNamespace() . 'Http\\Requests\\' . $this->model_name($name); 141 return $this->getRootNamespace() . 'Http\\Requests\\' . $this->model_name($name);
140 } 142 }
141 143 /**
144 * @return string
145 */
142 public function getRequestUses(string $name) 146 public function getRequestUses(string $name)
143 { 147 {
144 return implode("\n", [ 148 return implode("\n", [
145 "use " . $this->getRequestNamespace($name) . '\\' . $this->store_request_name($name), 149 "use " . $this->getRequestNamespace($name) . '\\' . $this->store_request_name($name),
146 "use " . $this->getRequestNamespace($name) . '\\' . $this->update_request_name($name), 150 "use " . $this->getRequestNamespace($name) . '\\' . $this->update_request_name($name),
170 public function human_readable_lc(string $name): string 174 public function human_readable_lc(string $name): string
171 { 175 {
172 return Str::lower($this->human_readable($name)); 176 return Str::lower($this->human_readable($name));
173 } 177 }
174 } 178 }
179
180 class Replacer
181 {
182 /**
183 * @return void
184 */
185 public function get_available_replacements(): array
186 {
187 }
188
189 public function getRequestUses(): string
190 {
191 }
192 }