Ver código fonte

refactor(migration): 统一数据库迁移基类为 Phinx\Migration\AbstractMigration,
统一代码风格

runphp 2 semanas atrás
pai
commit
9bd8578d06

+ 2 - 1
config.php

@@ -1,4 +1,5 @@
 <?php
+
 declare(strict_types=1);
 
 return json_decode(<<<'JSON'
@@ -912,4 +913,4 @@ return json_decode(<<<'JSON'
     "_fc_drag_tag": "fcEditor"
   }
 ]
-JSON,true);
+JSON, true);

+ 2 - 2
database/migrations/20250702075858_hello.php

@@ -1,8 +1,8 @@
 <?php
 
-use think\migration\Migrator;
+use Phinx\Migration\AbstractMigration;
 
-class Hello extends Migrator
+class Hello extends AbstractMigration
 {
     /**
      * Change Method.

+ 2 - 2
database/migrations/20250702093625_hello2.php

@@ -1,8 +1,8 @@
 <?php
 
-use think\migration\Migrator;
+use Phinx\Migration\AbstractMigration;
 
-class Hello2 extends Migrator
+class Hello2 extends AbstractMigration
 {
     /**
      * Change Method.

+ 2 - 1
info.php

@@ -1,4 +1,5 @@
 <?php
+
 declare(strict_types=1);
 
 
@@ -14,4 +15,4 @@ return [
     'website' => '', # 扩展的地址,可以是扩展的仓库地址,帮助用户寻找扩展,安装扩展等网络地址
     'image' => '', # 扩展的图片,用于展示扩展的图标,或者是扩展的截图等图片地址
     'license' => 'MIT', # 扩展的开源协议
-];
+];

+ 2 - 1
route/api.php

@@ -1,7 +1,8 @@
 <?php
+
 declare(strict_types=1);
 
 use SixShop\Hello\Controller\IndexController;
 use think\facade\Route;
 
-Route::resource('', IndexController::class);
+Route::resource('', IndexController::class);

+ 2 - 2
src/Controller/IndexController.php

@@ -1,4 +1,5 @@
 <?php
+
 declare(strict_types=1);
 
 namespace SixShop\Hello\Controller;
@@ -6,11 +7,10 @@ namespace SixShop\Hello\Controller;
 use SixShop\Core\Helper;
 use think\Response;
 
-
 class IndexController
 {
     public function index(): Response
     {
         return Helper::success_response('hello world');
     }
-}
+}

+ 2 - 2
src/Extension.php

@@ -1,4 +1,5 @@
 <?php
+
 declare(strict_types=1);
 
 namespace SixShop\Hello;
@@ -7,9 +8,8 @@ use SixShop\Core\ExtensionAbstract;
 
 class Extension extends ExtensionAbstract
 {
-
     protected function getBaseDir(): string
     {
         return dirname(__DIR__);
     }
-}
+}