瀏覽代碼

fix: style

Anankke 3 年之前
父節點
當前提交
42c0f57dc1
共有 3 個文件被更改,包括 6 次插入7 次删除
  1. 5 0
      phpinsights.php
  2. 0 5
      src/Command/Tool.php
  3. 1 2
      src/Services/Payment.php

+ 5 - 0
phpinsights.php

@@ -36,6 +36,11 @@ return [
                 'src/Command/PortAutoChange.php',
             ],
         ],
+        // Db migration should not have a class declaration
+        // If they have, phinx will unable to found them
+        PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class => [
+            'exclude' => [ 'db/migrations' ],
+        ],
     ],
 
     'exclude' => [

+ 0 - 5
src/Command/Tool.php

@@ -5,7 +5,6 @@ declare(strict_types=1);
 namespace App\Command;
 
 use App\Models\Setting;
-use App\Utils\DatatablesHelper;
 use App\Utils\QQWry;
 
 final class Tool extends Command
@@ -131,11 +130,8 @@ EOL;
 
     public function importAllSettings(): void
     {
-        $db = new DatatablesHelper();
-
         $json_settings = file_get_contents('./config/settings.json');
         $settings = json_decode($json_settings, true);
-        $number = count($settings);
         $counter = 0;
 
         foreach ($settings as $item) {
@@ -160,7 +156,6 @@ EOL;
             }
         }
 
-
         if ($counter !== 0) {
             echo "总计添加了 ${counter} 条新设置." . PHP_EOL;
         } else {

+ 1 - 2
src/Services/Payment.php

@@ -8,7 +8,6 @@ use App\Utils\ClassHelper;
 
 final class Payment
 {
-
     public static function getAllPaymentMap(): array
     {
         $payments = [];
@@ -27,7 +26,7 @@ final class Payment
 
     public static function getPaymentsEnabled()
     {
-        return array_values(array_filter(Payment::getAllPaymentMap(), function ($payment) {
+        return array_values(array_filter(Payment::getAllPaymentMap(), static function ($payment) {
             return $payment::_enable();
         }));
     }