Skip to content

Commit

Permalink
Remove parameter $withColumn from Quoter::getTableNameParts() (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed May 9, 2024
1 parent 32c563d commit f959dbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
## 2.0.0 under development

- Enh #293: Implement `SqlParser` and `ExpressionBuilder` driver classes (@Tigrov)
- Chg #306: Remove parameter `$withColumn` from `Quoter::getTableNameParts()` method (@Tigrov)

## 1.2.0 March 21, 2024

Expand Down
8 changes: 5 additions & 3 deletions src/Quoter.php
Expand Up @@ -6,6 +6,8 @@

use Yiisoft\Db\Schema\Quoter as BaseQuoter;

use function array_map;
use function array_slice;
use function preg_match;
use function preg_match_all;

Expand All @@ -27,10 +29,10 @@ public function getTableNameParts(string $name, bool $withColumn = false): array
{
if (preg_match_all('/([^.\[\]]+)|\[([^\[\]]+)]/', $name, $matches) > 0) {
$parts = array_slice($matches[0], -4, 4);
} else {
$parts = [$name];

return array_map([$this, 'unquoteSimpleTableName'], $parts);
}

return $this->unquoteParts($parts, $withColumn);
return [$this->unquoteSimpleTableName($name)];
}
}

0 comments on commit f959dbe

Please sign in to comment.