8000 formatting · laravel/framework@de561cb · GitHub
[go: up one dir, main page]

Skip to content

Commit de561cb

Browse files
committed
formatting
1 parent 5abf8fb commit de561cb

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/Illuminate/Database/Schema/PostgresBuilder.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class PostgresBuilder extends Builder
1212
*/
1313
public function hasTable($table)
1414
{
15-
[ $schema, $table ] = $this->getSchema($table);
15+
list($schema, $table) = $this->parseSchemaAndTable($table);
1616

1717
$table = $this->connection->getTablePrefix().$table;
1818

@@ -71,7 +71,7 @@ protected function getAllTables()
7171
*/
7272
public function getColumnListing($table)
7373
{
74-
[ $schema, $table ] = $this->getSchema($table);
74+
list($schema, $table) = $this->parseSchemaAndTable($table);
7575

7676
$table = $this->connection->getTablePrefix().$table;
7777

@@ -83,26 +83,23 @@ public function getColumnListing($table)
8383
}
8484

8585
/**
86-
* Determines which schema should be used.
86+
* Parse the table name and extract the schema and table.
8787
*
8888
* @param string $table
89-
* @return [ string, string ]
89+
* @return array
9090
*/
91-
protected function getSchema($table)
91+
protected function parseSchemaAndTable($table)
9292
{
9393
$table = explode('.', $table);
94-
$schema = $this->connection->getConfig('schema');
9594

96-
if (is_array($schema)) {
97-
if (in_array($table[0], $schema)) { // Table contains schema prefix
95+
if (is_array($schema = $this->connection->getConfig('schema'))) {
96+
if (in_array($table[0], $schema)) {
9897
return [array_shift($table), implode('.', $table)];
9998
}
10099

101100
$schema = head($schema);
102101
}
103102

104-
$schema = $schema ?: 'public';
105-
106-
return [$schema, implode('.', $table)];
103+
return [$schema ?: 'public', implode('.', $table)];
107104
}
108105
}

0 commit comments

Comments
 (0)
0