Passed
Push — main ( 303b6c...b49db2 )
by Sammy
01:47 queued 15s
created
src/Grammar/Deck.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
     public function addRaw(string $raw): self
30 30
     {
31
-        $this->aggregates .= ',' . $raw;
31
+        $this->aggregates .= ','.$raw;
32 32
         return $this;
33 33
     }
34 34
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $ret = is_string($aggregate) ? $aggregate : self::backtick($aggregate);
44 44
 
45 45
         if ($alias !== null) {
46
-            $ret .= ' AS ' . self::backtick($alias);
46
+            $ret .= ' AS '.self::backtick($alias);
47 47
         }
48 48
 
49 49
         return $ret;
Please login to merge, or discard this patch.
src/Grammar/Query/Select.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
         $schema = Grammar::backtick($this->table);
34 34
         if (!empty($this->alias)) {
35
-            $schema .= ' AS ' . Grammar::backtick($this->alias);
35
+            $schema .= ' AS '.Grammar::backtick($this->alias);
36 36
         }
37 37
 
38 38
         $ret = sprintf('SELECT %s FROM %s', $this->deck, $schema);
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
                 Clause::LIMIT
48 48
             ] as $clause
49 49
         ) {
50
-            if($this->clause($clause) === null)
50
+            if ($this->clause($clause) === null)
51 51
                 continue;
52 52
 
53
-            $ret .= PHP_EOL . $this->clause($clause);
53
+            $ret .= PHP_EOL.$this->clause($clause);
54 54
         }
55 55
 
56 56
         return $ret;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             if (is_int($alias)) {
88 88
                 $alias = null;
89 89
             }
90
-            if(!isset($this->deck)){
90
+            if (!isset($this->deck)) {
91 91
                 $this->deck = new Deck($column, $alias);
92 92
             } else {
93 93
                 $this->deck->add($column, $alias);
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,9 @@  discard block
 block discarded – undo
47 47
                 Clause::LIMIT
48 48
             ] as $clause
49 49
         ) {
50
-            if($this->clause($clause) === null)
51
-                continue;
50
+            if($this->clause($clause) === null) {
51
+                            continue;
52
+            }
52 53
 
53 54
             $ret .= PHP_EOL . $this->clause($clause);
54 55
         }
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
      */
80 81
     public function selectAlso(array $setter): self
81 82
     {
82
-        if (empty($setter))
83
-            throw new \InvalidArgumentException('EMPTY_SETTER_ARRAY');
83
+        if (empty($setter)) {
84
+                    throw new \InvalidArgumentException('EMPTY_SETTER_ARRAY');
85
+        }
84 86
 
85 87
         foreach ($setter as $alias => $column) {
86 88
 
Please login to merge, or discard this patch.
src/Grammar/Clause/GroupBy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
     public function __toString()
23 23
     {
24
-        return 'GROUP BY ' . $this->deck;
24
+        return 'GROUP BY '.$this->deck;
25 25
     }
26 26
 
27 27
     public function name(): string
Please login to merge, or discard this patch.
src/Grammar/Clause/OrderBy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
     public function __toString()
24 24
     {
25
-        return 'ORDER BY ' . $this->deck;
25
+        return 'ORDER BY '.$this->deck;
26 26
     }
27 27
 
28 28
 
Please login to merge, or discard this patch.
src/Grammar/Clause/SelectFrom.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 
66 66
         $schema = self::backtick($this->table);
67 67
         if (!empty($this->alias)) {
68
-            $schema .= ' AS ' . self::backtick($this->alias);
68
+            $schema .= ' AS '.self::backtick($this->alias);
69 69
         }
70 70
 
71 71
         $columns = implode(',', $this->columns);
Please login to merge, or discard this patch.
src/Grammar/DeckOrderBy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     protected function format($aggregate, string $direction = null): string
10 10
     {
11 11
         $ret = is_string($aggregate) ? $aggregate : self::backtick($aggregate);
12
-        $ret .= ' ' . in_array($direction, ['ASC', 'DESC']) ? $direction : 'ASC';
12
+        $ret .= ' '.in_array($direction, ['ASC', 'DESC']) ? $direction : 'ASC';
13 13
 
14 14
         return $ret;
15 15
     }
Please login to merge, or discard this patch.
src/Schema/Schema.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
     public function column(string $table, string $column): array
53 53
     {
54 54
         if (!$this->hasColumn($table, $column)) {
55
-            throw new \InvalidArgumentException('CANNOT FIND COLUMN ' . $column . ' IN TABLE ' . $table);
55
+            throw new \InvalidArgumentException('CANNOT FIND COLUMN '.$column.' IN TABLE '.$table);
56 56
         }
57 57
 
58
-        if(!isset($this->tables[$table]['columns'][$column]['schema'])){
58
+        if (!isset($this->tables[$table]['columns'][$column]['schema'])) {
59 59
             throw new \InvalidArgumentException("ERR_MISSING_COLUMN_SCHEMA");
60 60
         }
61 61
 
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
 
159 159
     public function select(string $table, array $columns = null, string $table_alias = null): QueryInterface
160 160
     {
161
-        if(in_array('*', $columns)){
161
+        if (in_array('*', $columns)) {
162 162
             $filtered_columns = ['*'];
163 163
         }
164
-        else{
164
+        else {
165 165
             $filtered_columns = array_intersect($columns, $this->columns($table));
166 166
         } 
167 167
         
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -160,8 +160,7 @@
 block discarded – undo
160 160
     {
161 161
         if(in_array('*', $columns)){
162 162
             $filtered_columns = ['*'];
163
-        }
164
-        else{
163
+        } else{
165 164
             $filtered_columns = array_intersect($columns, $this->columns($table));
166 165
         } 
167 166
         
Please login to merge, or discard this patch.
src/Schema/SchemaLoader.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 
22 22
     public static function cache(string $database): ?SchemaInterface
23 23
     {
24
-        $cache_file = __DIR__ . '/cache/' . $database . '.php';
25
-        if(!file_exists($cache_file)){
24
+        $cache_file = __DIR__.'/cache/'.$database.'.php';
25
+        if (!file_exists($cache_file)) {
26 26
             return null;
27 27
         }
28 28
 
@@ -36,18 +36,18 @@  discard block
 block discarded – undo
36 36
             $pdo->beginTransaction();
37 37
             
38 38
             // switch to the INFORMATION_SCHEMA database
39
-            if(false === $pdo->query(sprintf('USE %s;', $schema_database))){
39
+            if (false === $pdo->query(sprintf('USE %s;', $schema_database))) {
40 40
                 throw new CruditesException('SWICTH_TO_INFORMATION_SCHEMA');
41 41
             }
42 42
             
43 43
             // get the schema information
44 44
             $res = $pdo->query(self::informationSchemaQuery($database));
45
-            if(false === $res){
45
+            if (false === $res) {
46 46
                 throw new CruditesException('LOAD_INFORMATION_SCHEMA');
47 47
             }
48 48
             
49 49
             // switch back to the original database
50
-            if(false === $pdo->query(sprintf('USE %s;', $database))){
50
+            if (false === $pdo->query(sprintf('USE %s;', $database))) {
51 51
                 throw new CruditesException('SWICTH_BACK_TO_USER_DATABASE');
52 52
             }
53 53
 
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
         }
61 61
 
62 62
         $res = $res->fetchAll();
63
-        if($res === false){
63
+        if ($res === false) {
64 64
             throw new CruditesException('SCHEMA_LOAD_FETCHALL');
65 65
         }
66 66
         
67
-        if(empty($res)){
67
+        if (empty($res)) {
68 68
             throw new CruditesException('SCHEMA_LOAD_FETCHED_EMPTY_RESULTS');
69 69
         }
70 70
 
Please login to merge, or discard this patch.