diff --git a/src/Command/GMigration.php b/src/Command/GMigration.php index 48c07adf..58c8ae2b 100644 --- a/src/Command/GMigration.php +++ b/src/Command/GMigration.php @@ -30,7 +30,7 @@ protected function handle() $plugin = $this->plugin->getOneById($this->getPluginId()); $path = $plugin->getBasePath() . '/src/Migration'; $reflection = new \ReflectionClass($plugin); - $namespace = $reflection->getNamespaceName() . '\\Migration'; + $namespace = $reflection->getNamespaceName() . '\Migration'; Migration::setOutput($this->output)->create([ 'name' => $this->getArgument('name'), diff --git a/src/Command/GRelation.php b/src/Command/GRelation.php index d3f5ee63..dda3f2e7 100644 --- a/src/Command/GRelation.php +++ b/src/Command/GRelation.php @@ -53,7 +53,7 @@ protected function createTrait($name, $relation, $isPluralize = false) // Generate file $phpFile = new PhpFile(); - $namespace = $phpFile->addNamespace('Miaoxing\\' . $pluginNamespace . '\\Model'); + $namespace = $phpFile->addNamespace('Miaoxing\\' . $pluginNamespace . '\Model'); $namespace->addUse($class); // Generate trait diff --git a/src/Command/GSeeder.php b/src/Command/GSeeder.php index e63a89ec..9f3a2b89 100644 --- a/src/Command/GSeeder.php +++ b/src/Command/GSeeder.php @@ -27,7 +27,7 @@ protected function handle() $plugin = $this->plugin->getOneById($this->getArgument('plugin')); $path = $plugin->getBasePath() . '/src/Seeder'; $reflection = new \ReflectionClass($plugin); - $namespace = $reflection->getNamespaceName() . '\\Seeder'; + $namespace = $reflection->getNamespaceName() . '\Seeder'; Seeder::setOutput($this->output)->create([ 'name' => $this->getArgument('name'), diff --git a/src/Service/Plugin.php b/src/Service/Plugin.php index 39d5650a..c22f9480 100644 --- a/src/Service/Plugin.php +++ b/src/Service/Plugin.php @@ -625,7 +625,7 @@ protected function getEventsById($id) */ protected function dash($name) { - return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '-$1', $name)); + return strtolower(preg_replace('~(?<=\w)([A-Z])~', '-$1', $name)); } /** diff --git a/src/Test/BaseControllerTestCase.php b/src/Test/BaseControllerTestCase.php index a2cc1e24..36ea6e99 100644 --- a/src/Test/BaseControllerTestCase.php +++ b/src/Test/BaseControllerTestCase.php @@ -27,7 +27,7 @@ abstract class BaseControllerTestCase extends BaseTestCase public function getController() { if (!$this->controller) { - preg_match('/Controller\\\\(.+?)ControllerTest/', static::class, $matches); + preg_match('/Controller\\\(.+?)ControllerTest/', static::class, $matches); $values = []; foreach (explode('\\', $matches[1]) as $value) { $values[] = lcfirst($value);