comparison src/Generator/Route/RouteGenerator.php @ 7:769a17898cc0

Various changes to the generators and replacers - probably mostly just formatting
author luka
date Wed, 18 Oct 2023 21:04:11 -0400
parents b0b2e79ad8e6
children 81a76472ba21
comparison
equal deleted inserted replaced
6:b46922d4a301 7:769a17898cc0
2 2
3 namespace Wizzard\MagicForger\Generator\Route; 3 namespace Wizzard\MagicForger\Generator\Route;
4 4
5 use Symfony\Component\Console\Attribute\AsCommand; 5 use Symfony\Component\Console\Attribute\AsCommand;
6 use Wizzard\MagicForger\Generator\BaseGenerator; 6 use Wizzard\MagicForger\Generator\BaseGenerator;
7 use Wizzard\MagicForger\Replacer;
8 use Illuminate\Support\Str;
9 7
10 #[AsCommand(name: 'mf:routes')] 8 #[AsCommand(name: 'mf:routes')]
11 class RouteGenerator extends BaseGenerator 9 class RouteGenerator extends BaseGenerator
12 { 10 {
13 /** 11 /**
50 } 48 }
51 49
52 /** 50 /**
53 * Resolve the fully-qualified path to the stub. 51 * Resolve the fully-qualified path to the stub.
54 * 52 *
55 * @param string $stub 53 * @param string $stub
54 *
56 * @return string 55 * @return string
57 */ 56 */
58 protected function resolveStubPath($stub) 57 protected function resolveStubPath($stub)
59 { 58 {
60 return is_file($customPath = $this->laravel->basePath(trim($stub, '/'))) 59 return is_file($customPath = $this->laravel->basePath(trim($stub, '/')))
72 * 71 *
73 * @return string 72 * @return string
74 */ 73 */
75 protected function getPath($name = null) 74 protected function getPath($name = null)
76 { 75 {
77 return str_replace(['App\\', '\\'], ['app/', '/'], $this->getRouteNamespace() . '/' . $this->routes_name($this->getTableInput()) . '.php'); 76 return str_replace(['App\\', '\\'], ['app/', '/'], $this->getRouteNamespace().'/'.$this->routes_name($this->getTableInput()).'.php');
78 } 77 }
79 } 78 }