Passed
Push — main ( 25ea52...815284 )
by Pranjal
02:14
created
src/Manager/RecordManager.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -69,17 +69,17 @@
 block discarded – undo
69 69
     }
70 70
 
71 71
     /**
72
-    * Get single record by id
73
-    * @param string $table
74
-    * @param mixed $id
75
-    */
72
+     * Get single record by id
73
+     * @param string $table
74
+     * @param mixed $id
75
+     */
76 76
     public function getById(string $table, mixed $id): Model|null
77 77
     {
78 78
         $query =  (new QueryBuilder($this->connection,$this->modelManager))
79
-                 ->select('*')
80
-                 ->from($table, 't')
81
-                 ->where("t.id = ?")
82
-                 ->setParameter(0, $id);
79
+                    ->select('*')
80
+                    ->from($table, 't')
81
+                    ->where("t.id = ?")
82
+                    ->setParameter(0, $id);
83 83
 
84 84
         return $query->first();
85 85
     }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     /**
23 23
      * Create RecordManager
24 24
      */
25
-    public function __construct(Connection $connection, ModelManager $modelManager,bool $isUsingUUID = false)
25
+    public function __construct(Connection $connection, ModelManager $modelManager, bool $isUsingUUID = false)
26 26
     {
27 27
         $this->connection = $connection;
28 28
         $this->isUsingUUID = $isUsingUUID;
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function insert(Model $model) : mixed
38 38
     {
39 39
         if ($this->isUsingUUID) {
40
-            $model->set('id',UUID::uuid4()->toString());
40
+            $model->set('id', UUID::uuid4()->toString());
41 41
         }
42 42
         $this->connection->insert($model->getName(), $model->getSelfProperties());
43 43
         if ($this->isUsingUUID) {
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
     * @param string $table
74 74
     * @param mixed $id
75 75
     */
76
-    public function getById(string $table, mixed $id): Model|null
76
+    public function getById(string $table, mixed $id): Model | null
77 77
     {
78
-        $query =  (new QueryBuilder($this->connection,$this->modelManager))
78
+        $query = (new QueryBuilder($this->connection, $this->modelManager))
79 79
                  ->select('*')
80 80
                  ->from($table, 't')
81 81
                  ->where("t.id = ?")
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function getAll(string $tableName): Collection
93 93
     {
94
-        return (new QueryBuilder($this->connection,$this->modelManager))
94
+        return (new QueryBuilder($this->connection, $this->modelManager))
95 95
             ->select('*')
96 96
             ->from($tableName, 't')
97 97
             ->get();
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function find(String $name) : QueryBuilder
105 105
     {
106
-        return (new QueryBuilder($this->connection,$this->modelManager))
106
+        return (new QueryBuilder($this->connection, $this->modelManager))
107 107
         ->select('*')
108 108
         ->from($name, 't');
109 109
     }
Please login to merge, or discard this patch.