From 8d0b81990850017aa0e5c69b992e054238390a67 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 22:26:15 +0000 Subject: [PATCH] style: Format code with php-cs-fixer --- deploy/lib/data/Message.php | 4 ++-- deploy/lib/data/NWQuery.php | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/deploy/lib/data/Message.php b/deploy/lib/data/Message.php index 0a7aba9fe..a8ba81c41 100644 --- a/deploy/lib/data/Message.php +++ b/deploy/lib/data/Message.php @@ -8,8 +8,8 @@ class Message extends NWQuery { - static protected $primaryKey = 'message_id'; // if anything other than id - static protected $table = 'messages'; + protected static $primaryKey = 'message_id'; // if anything other than id + protected static $table = 'messages'; public $timestamps = false; // The non-mass-fillable fields protected $guarded = ['message_id', 'date']; diff --git a/deploy/lib/data/NWQuery.php b/deploy/lib/data/NWQuery.php index 0b8c986b2..bc56e4c13 100644 --- a/deploy/lib/data/NWQuery.php +++ b/deploy/lib/data/NWQuery.php @@ -8,12 +8,11 @@ use Carbon\Carbon; /** - * Acts as a mini model and query builder with an ActiveRecord pattern + * Acts as a mini model and query builder with an ActiveRecord pattern * (e.g. Message::find(id) $message->save(), whatever nw needs) */ abstract class NWQuery { - private static $model; // Inheriting classes need to set primaryKey and table as: // protected $primaryKey; @@ -80,7 +79,6 @@ public static function query($builder) */ public static function find($id) { - $found_data = reset(self::query(['select * from ' . static::$table . ' where ' . static::$primaryKey . ' = :id', [':id' => $id]])); $model = new static(); foreach ($found_data as $key => $value) {