@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $pathname = $this->getPathName($classname); |
41 | 41 | |
42 | 42 | if (is_file($pathname)) { |
43 | - $output->writeln('<error>' . $this->type . ' already exists!</error>'); |
|
43 | + $output->writeln('<error>'.$this->type.' already exists!</error>'); |
|
44 | 44 | return false; |
45 | 45 | } |
46 | 46 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | file_put_contents($pathname, $this->buildClass($classname)); |
52 | 52 | |
53 | - $output->writeln('<info>' . $this->type . ' created successfully.</info>'); |
|
53 | + $output->writeln('<info>'.$this->type.' created successfully.</info>'); |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $namespace = trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\'); |
62 | 62 | |
63 | - $class = str_replace($namespace . '\\', '', $name); |
|
63 | + $class = str_replace($namespace.'\\', '', $name); |
|
64 | 64 | |
65 | 65 | return str_replace(['{%className%}', '{%actionSuffix%}', '{%namespace%}', '{%app_namespace%}'], [ |
66 | 66 | $class, |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | |
73 | 73 | protected function getPathName($name) |
74 | 74 | { |
75 | - $name = str_replace(App::getNamespace() . '\\', '', $name); |
|
75 | + $name = str_replace(App::getNamespace().'\\', '', $name); |
|
76 | 76 | |
77 | - return Env::get('app_path') . ltrim(str_replace('\\', '/', $name), '/') . '.php'; |
|
77 | + return Env::get('app_path').ltrim(str_replace('\\', '/', $name), '/').'.php'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | protected function getClassName($name) |
81 | 81 | { |
82 | 82 | $appNamespace = App::getNamespace(); |
83 | 83 | |
84 | - if (strpos($name, $appNamespace . '\\') !== false) { |
|
84 | + if (strpos($name, $appNamespace.'\\') !== false) { |
|
85 | 85 | return $name; |
86 | 86 | } |
87 | 87 | |
@@ -99,17 +99,17 @@ discard block |
||
99 | 99 | $name = str_replace('/', '\\', $name); |
100 | 100 | } |
101 | 101 | |
102 | - return $this->getNamespace($appNamespace, $module) . '\\' . $name; |
|
102 | + return $this->getNamespace($appNamespace, $module).'\\'.$name; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | protected function getNamespace($appNamespace, $module) |
106 | 106 | { |
107 | - if(!empty($module)){ |
|
108 | - if(!ctype_lower($module)){ |
|
107 | + if (!empty($module)) { |
|
108 | + if (!ctype_lower($module)) { |
|
109 | 109 | $this->output->warning('[Warning]: Module name is only allowed to use lowercase!'); |
110 | 110 | $module = strtolower($module); |
111 | 111 | } |
112 | - return $appNamespace . '\\' . $module; |
|
112 | + return $appNamespace.'\\'.$module; |
|
113 | 113 | } |
114 | 114 | return $appNamespace; |
115 | 115 | } |