@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function dropForeignIfExists($index, Connection $connection = null) |
| 18 | 18 | { |
| 19 | 19 | // Drop the Foreign Key if it exists |
| 20 | - if($this->foreignExists($index, $connection)) { |
|
| 20 | + if ($this->foreignExists($index, $connection)) { |
|
| 21 | 21 | return $this->dropForeign($index); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | public function createdBy($table = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 91 | 91 | { |
| 92 | 92 | // Determine the Table |
| 93 | - if(is_null($table)) { |
|
| 93 | + if (is_null($table)) { |
|
| 94 | 94 | $table = $this->getTimestampsByTable(); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | public function bigCreatedBy($table = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 132 | 132 | { |
| 133 | 133 | // Determine the Table |
| 134 | - if(is_null($table)) { |
|
| 134 | + if (is_null($table)) { |
|
| 135 | 135 | $table = $this->getTimestampsByTable(); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | public function updatedBy($table = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 173 | 173 | { |
| 174 | 174 | // Determine the Table |
| 175 | - if(is_null($table)) { |
|
| 175 | + if (is_null($table)) { |
|
| 176 | 176 | $table = $this->getTimestampsByTable(); |
| 177 | 177 | } |
| 178 | 178 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | public function bigUpdatedBy($table = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 214 | 214 | { |
| 215 | 215 | // Determine the Table |
| 216 | - if(is_null($table)) { |
|
| 216 | + if (is_null($table)) { |
|
| 217 | 217 | $table = $this->getTimestampsByTable(); |
| 218 | 218 | } |
| 219 | 219 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | public function belongsTo($table, $foreign = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 22 | 22 | { |
| 23 | 23 | // Determine the Name of the Foreign Key |
| 24 | - if(is_null($foreign)) { |
|
| 24 | + if (is_null($foreign)) { |
|
| 25 | 25 | $foreign = Str::singular($table) . '_id'; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function bigBelongsTo($table, $foreign = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 51 | 51 | { |
| 52 | 52 | // Determine the Name of the Foreign Key |
| 53 | - if(is_null($foreign)) { |
|
| 53 | + if (is_null($foreign)) { |
|
| 54 | 54 | $foreign = Str::singular($table) . '_id'; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -108,22 +108,22 @@ discard block |
||
| 108 | 108 | public function belongsToForeign($table, $foreign = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 109 | 109 | { |
| 110 | 110 | // Determine the Name of the Foreign Key |
| 111 | - if(is_null($foreign)) { |
|
| 111 | + if (is_null($foreign)) { |
|
| 112 | 112 | $foreign = Str::singular($table) . '_id'; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // Determine the Name of the Local Key |
| 116 | - if(is_null($local)) { |
|
| 116 | + if (is_null($local)) { |
|
| 117 | 117 | $local = 'id'; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | // Determine the Update Constraint |
| 121 | - if(is_null($onUpdate)) { |
|
| 121 | + if (is_null($onUpdate)) { |
|
| 122 | 122 | $onUpdate = $this->getConfig('belongsTo.onUpdate'); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | // Determine the Delete Constraint |
| 126 | - if(is_null($onDelete)) { |
|
| 126 | + if (is_null($onDelete)) { |
|
| 127 | 127 | $onDelete = $this->getConfig('belongsTo.onDelete'); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | public function dropBelongsTo($table, $foreign = null, $local = null, $name = null) |
| 145 | 145 | { |
| 146 | 146 | // Determine the Name of the Foreign Key |
| 147 | - if(is_null($foreign)) { |
|
| 147 | + if (is_null($foreign)) { |
|
| 148 | 148 | $foreign = Str::singular($table) . '_id'; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -180,17 +180,17 @@ discard block |
||
| 180 | 180 | public function dropBelongsToForeign($table, $foreign = null, $local = null, $name = null) |
| 181 | 181 | { |
| 182 | 182 | // Check for a Name |
| 183 | - if(!is_null($name)) { |
|
| 183 | + if (!is_null($name)) { |
|
| 184 | 184 | return $this->dropForeign($name); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | // Determine the Name of the Foreign Key |
| 188 | - if(is_null($foreign)) { |
|
| 188 | + if (is_null($foreign)) { |
|
| 189 | 189 | $foreign = Str::singular($table) . '_id'; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | // Determine the Name of the Local Key |
| 193 | - if(is_null($local)) { |
|
| 193 | + if (is_null($local)) { |
|
| 194 | 194 | $local = 'id'; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | public function deletedBy($table = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 75 | 75 | { |
| 76 | 76 | // Determine the Table |
| 77 | - if(is_null($table)) { |
|
| 77 | + if (is_null($table)) { |
|
| 78 | 78 | $table = $this->getTimestampsByTable(); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | public function bigDeletedBy($table = null, $local = null, $name = null, $onUpdate = null, $onDelete = null) |
| 116 | 116 | { |
| 117 | 117 | // Determine the Table |
| 118 | - if(is_null($table)) { |
|
| 118 | + if (is_null($table)) { |
|
| 119 | 119 | $table = $this->getTimestampsByTable(); |
| 120 | 120 | } |
| 121 | 121 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $index->references('id'); |
| 24 | 24 | |
| 25 | 25 | // Declare ON if specified |
| 26 | - if(!is_null($on)) { |
|
| 26 | + if (!is_null($on)) { |
|
| 27 | 27 | $index->on($on); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $abbreviation = $this->createIndexTypeName($type); |
| 70 | 70 | |
| 71 | 71 | // Determine the Foreign Key Table Reference |
| 72 | - if($type == 'foreign' && is_null($foreign)) { |
|
| 72 | + if ($type == 'foreign' && is_null($foreign)) { |
|
| 73 | 73 | $foreign = $this->createForeignIndexName($columns); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $columns = implode('_', $columns); |
| 78 | 78 | |
| 79 | 79 | // Determine the Index Name |
| 80 | - if(isset($foreign)) { |
|
| 80 | + if (isset($foreign)) { |
|
| 81 | 81 | $index = $abbreviation . strtolower("_{$this->table}_{$foreign}_{$columns}"); |
| 82 | 82 | } else { |
| 83 | 83 | $index = $abbreviation . strtolower("_{$this->table}_{$columns}"); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | protected function createIndexTypeName($type) |
| 98 | 98 | { |
| 99 | 99 | // Convert Type to Abbreviation |
| 100 | - switch($type) { |
|
| 100 | + switch ($type) { |
|
| 101 | 101 | |
| 102 | 102 | // Primary Key |
| 103 | 103 | case 'primary': |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $tables = []; |
| 134 | 134 | |
| 135 | 135 | // Determine the Tables being References |
| 136 | - foreach($columns as $column) { |
|
| 136 | + foreach ($columns as $column) { |
|
| 137 | 137 | |
| 138 | 138 | // Derive the Table Name from the Column |
| 139 | 139 | $table = $this->getTableNameFromColumn($column); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | protected function getTableNameFromColumn($column) |
| 158 | 158 | { |
| 159 | 159 | // Make sure the Table has an ID Suffix |
| 160 | - if(!Str::endsWith($column, '_id')) { |
|
| 160 | + if (!Str::endsWith($column, '_id')) { |
|
| 161 | 161 | return null; |
| 162 | 162 | } |
| 163 | 163 | |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | [$one, $two, $caller] = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 3); |
| 66 | 66 | |
| 67 | 67 | // Check for Blueprint Caller |
| 68 | - if($caller['object'] instanceof Blueprint) { |
|
| 68 | + if ($caller['object'] instanceof Blueprint) { |
|
| 69 | 69 | return $caller['object']; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // Check for Columns Caller |
| 73 | - if($caller['object'] instanceof static) { |
|
| 73 | + if ($caller['object'] instanceof static) { |
|
| 74 | 74 | return $caller['object']->getBlueprint(); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | public function __call($method, $parameters) |
| 103 | 103 | { |
| 104 | 104 | // Check for Macro |
| 105 | - if(static::hasMacro($method)) { |
|
| 105 | + if (static::hasMacro($method)) { |
|
| 106 | 106 | return parent::__call($method, $parameters); |
| 107 | 107 | } |
| 108 | 108 | |