@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | |
12 | 12 | public function createRow(): string |
13 | 13 | { |
14 | - return preg_replace('/\s+/',' ',trim($this->query)); |
|
14 | + return preg_replace('/\s+/', ' ', trim($this->query)); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function id($type = "int"): static |
18 | 18 | { |
19 | - if($type == "int"){ |
|
19 | + if ($type == "int") { |
|
20 | 20 | $this->integer('id')->unsigned()->notNull()->primaryKey(); |
21 | - }else{ |
|
21 | + } else { |
|
22 | 22 | $this->bigint('id')->unsigned()->notNull()->primaryKey(); |
23 | 23 | } |
24 | 24 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | return $this; |
32 | 32 | } |
33 | 33 | |
34 | - public function string(string $name,int $limit = 255): static |
|
34 | + public function string(string $name, int $limit = 255): static |
|
35 | 35 | { |
36 | 36 | $this->query = "`$name` varchar(" . $limit . ")"; |
37 | 37 | return $this; |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | |
46 | 46 | public function timestamp(string $name): static |
47 | 47 | { |
48 | - $this->query = "`$name` timestamp"; |
|
48 | + $this->query = "`$name` timestamp"; |
|
49 | 49 | return $this; |
50 | 50 | } |
51 | 51 | |
52 | 52 | public function bigInt(string $name): static |
53 | 53 | { |
54 | - $this->query = "`$name` bigInt"; |
|
54 | + $this->query = "`$name` bigInt"; |
|
55 | 55 | return $this; |
56 | 56 | } |
57 | 57 | |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | public function foreignKey(string $name): static |
105 | 105 | { |
106 | 106 | $rand = rand(); |
107 | - $constrain = "CONSTRAINT `".$name ."_foreignKey_" .$rand . "` "; |
|
107 | + $constrain = "CONSTRAINT `" . $name . "_foreignKey_" . $rand . "` "; |
|
108 | 108 | $foreignKey = "FOREIGN KEY (`" . $name . "`)"; |
109 | 109 | $this->query = $constrain . $foreignKey; |
110 | 110 | return $this; |
111 | 111 | } |
112 | 112 | |
113 | - public function references(string $name,string $row = 'id'): static |
|
113 | + public function references(string $name, string $row = 'id'): static |
|
114 | 114 | { |
115 | 115 | $this->query .= " REFERENCES `$name` (`$row`)"; |
116 | 116 | return $this; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | if($type == "int"){ |
20 | 20 | $this->integer('id')->unsigned()->notNull()->primaryKey(); |
21 | - }else{ |
|
21 | + } else{ |
|
22 | 22 | $this->bigint('id')->unsigned()->notNull()->primaryKey(); |
23 | 23 | } |
24 | 24 |