Skip to content

Commit

Permalink
style: Format code with php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsource-autofix[bot] authored Aug 28, 2023
1 parent 118d504 commit 8d0b819
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions deploy/lib/data/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
4 changes: 1 addition & 3 deletions deploy/lib/data/NWQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8d0b819

Please sign in to comment.