Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove parameter $withColumn from Quoter::getTableNameParts() #306

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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)];
}
}
Loading