Skip to content

Remove unused private platform methods #5944

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

Merged
merged 1 commit into from
Mar 1, 2023
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
22 changes: 0 additions & 22 deletions src/Platforms/PostgreSQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,28 +166,6 @@ public function getListViewsSQL(string $database): string
WHERE view_definition IS NOT NULL';
}

private function getTableWhereClause(string $table, string $classAlias = 'c', string $namespaceAlias = 'n'): string
{
$whereClause = $namespaceAlias . ".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND ";
if (str_contains($table, '.')) {
[$schema, $table] = explode('.', $table);
$schema = $this->quoteStringLiteral($schema);
} else {
$schema = 'ANY(current_schemas(false))';
}

$table = new Identifier($table);
$table = $this->quoteStringLiteral($table->getName());

return $whereClause . sprintf(
'%s.relname = %s AND %s.nspname = %s',
$classAlias,
$table,
$namespaceAlias,
$schema,
);
}

/** @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */
public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey): string
{
Expand Down
36 changes: 0 additions & 36 deletions src/Platforms/SQLServerPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
use function array_merge;
use function array_unique;
use function array_values;
use function crc32;
use function dechex;
use function explode;
use function implode;
use function is_array;
Expand Down Expand Up @@ -736,27 +734,6 @@ public function getListViewsSQL(string $database): string
WHERE type = 'V' ORDER BY name";
}

/**
* Returns the where clause to filter schema and table name in a query.
*
* @param string $table The full qualified name of the table.
* @param string $schemaColumn The name of the column to compare the schema to in the where clause.
* @param string $tableColumn The name of the column to compare the table to in the where clause.
*/
private function getTableWhereClause(string $table, string $schemaColumn, string $tableColumn): string
{
if (str_contains($table, '.')) {
[$schema, $table] = explode('.', $table);
$schema = $this->quoteStringLiteral($schema);
$table = $this->quoteStringLiteral($table);
} else {
$schema = 'SCHEMA_NAME()';
$table = $this->quoteStringLiteral($table);
}

return sprintf('(%s = %s AND %s = %s)', $tableColumn, $table, $schemaColumn, $schema);
}

public function getLocateExpression(string $string, string $substring, ?string $start = null): string
{
if ($start === null) {
Expand Down Expand Up @@ -1186,19 +1163,6 @@ protected function getLikeWildcardCharacters(): string
return parent::getLikeWildcardCharacters() . '[]^';
}

/**
* Returns a hash value for a given identifier.
*
* @param string $identifier Identifier to generate a hash value for.
*/
private function generateIdentifierName(string $identifier): string
{
// Always generate name for unquoted identifiers to ensure consistency.
$identifier = new Identifier($identifier);

return strtoupper(dechex(crc32($identifier->getName())));
}

protected function getCommentOnTableSQL(string $tableName, string $comment): string
{
return sprintf(
Expand Down