diff --git a/src/Console/MakeSettingCommand.php b/src/Console/MakeSettingCommand.php index 0941429..d28bc22 100644 --- a/src/Console/MakeSettingCommand.php +++ b/src/Console/MakeSettingCommand.php @@ -108,27 +108,27 @@ protected function getPath($name, $path): string return $path . '/' . $name . '.php'; } -protected function getNamespace($path): string -{ - $path = preg_replace( - [ - '/^(' . preg_quote(base_path(), '/') . ')/', - '/\//', - ], - [ - '', - '\\', - ], - $path - ); - - $namespace = implode('\\', array_map(fn ($directory) => ucfirst($directory), explode('\\', $path))); - - // Remove leading backslash if present - if (substr($namespace, 0, 1) === '\\') { - $namespace = substr($namespace, 1); - } + protected function getNamespace($path): string + { + $path = preg_replace( + [ + '/^(' . preg_quote(base_path(), '/') . ')/', + '/\//', + ], + [ + '', + '\\', + ], + $path + ); - return $namespace; -} + $namespace = implode('\\', array_map(fn ($directory) => ucfirst($directory), explode('\\', $path))); + + // Remove leading backslash if present + if (substr($namespace, 0, 1) === '\\') { + $namespace = substr($namespace, 1); + } + + return $namespace; + } }