Test Failed
Branch main (1a7499)
by Pranjal
02:46
created
src/Model.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -66,22 +66,22 @@
 block discarded – undo
66 66
         if (preg_match('/[A-Z]/', $key)) {
67 67
             $parts = preg_split('/(?=[A-Z])/', $key, -1, PREG_SPLIT_NO_EMPTY);
68 68
             if (strtolower($parts[0]) == 'own') {
69
-                if (strtolower($parts[2])  == 'list') {
70
-                    return Database::getInstance()->find(strtolower($parts[1]))->where($this->getName() . '_id = ' . $this->_id)->get();
69
+                if (strtolower($parts[2]) == 'list') {
70
+                    return Database::getInstance()->find(strtolower($parts[1]))->where($this->getName().'_id = '.$this->_id)->get();
71 71
                 }
72 72
             }
73 73
             if (strtolower($parts[0]) == 'shared') {
74
-                if (strtolower($parts[2])  == 'list') {
74
+                if (strtolower($parts[2]) == 'list') {
75 75
                     $rel_table = Database::getInstance()->getTableManager()->tableExists($this->table.'_'.strtolower($parts[1])) ? $this->table.'_'.strtolower($parts[1]) : strtolower($parts[1]).'_'.$this->table;
76 76
                     print('table: '.$rel_table);
77
-                    $relations = Database::getInstance()->find($rel_table)->where($this->getName() . '_id = ' . $this->_id)->get();
77
+                    $relations = Database::getInstance()->find($rel_table)->where($this->getName().'_id = '.$this->_id)->get();
78 78
                     $rel_ids = [];
79 79
                     foreach ($relations as $relation) {
80
-                        $key = strtolower($parts[1]) . '_id';
80
+                        $key = strtolower($parts[1]).'_id';
81 81
                         array_push($rel_ids, $relation->$key);
82 82
                     }
83 83
                     print('near return');
84
-                    return Database::getInstance()->find(strtolower($parts[1]))->where('id IN (' . implode(',', $rel_ids) . ')')->get();
84
+                    return Database::getInstance()->find(strtolower($parts[1]))->where('id IN ('.implode(',', $rel_ids).')')->get();
85 85
                 }
86 86
             }
87 87
         }
Please login to merge, or discard this patch.
src/Database.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      * @param array $params
31 31
      * @return integer
32 32
      */
33
-    public function exec(string $sql, array $params=array()): int
33
+    public function exec(string $sql, array $params = array()): int
34 34
     {
35 35
         return  $this->connection->executeStatement($sql, $params);
36 36
     }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @param array $params
43 43
      * @return array
44 44
      */
45
-    public function getAll(string $sql, array $params=[]): array
45
+    public function getAll(string $sql, array $params = []): array
46 46
     {
47 47
         return  $this->connection->executeQuery($sql, $params)->fetchAllAssociative();
48 48
     }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      * @param integer|null $id
230 230
      * @return mixed
231 231
      */
232
-    public function get(String $table, int $id=null) : mixed
232
+    public function get(String $table, int $id = null) : mixed
233 233
     {
234 234
         if (is_null($id)) {
235 235
             return $this->recordManager->getAll($table);
Please login to merge, or discard this patch.