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

fix: DefaultQuoteStrategy not Oracle db compatible #11713

Open
wants to merge 1 commit into
base: 2.20.x
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions src/Mapping/DefaultQuoteStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use function array_map;
use function array_merge;
use function is_numeric;

Check failure on line 12 in src/Mapping/DefaultQuoteStrategy.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.3)

Type is_numeric is not used in this file.
use function preg_replace;
use function substr;

Expand Down Expand Up @@ -145,11 +145,12 @@
// 2 ) Trim the column alias to the maximum identifier length of the platform.
// If the alias is to long, characters are cut off from the beginning.
// 3 ) Strip non alphanumeric characters
// 4 ) Prefix with "_" if the result its numeric
// 4 ) Replace first character with "C" if it is not an alphabetic character
$columnName .= '_' . $counter;

Check failure on line 149 in src/Mapping/DefaultQuoteStrategy.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.3)

Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space
$columnName = substr($columnName, -$platform->getMaxIdentifierLength());

Check failure on line 150 in src/Mapping/DefaultQuoteStrategy.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.3)

Equals sign not aligned with surrounding assignments; expected 8 spaces but found 2 spaces
$columnName = preg_replace('/[^A-Za-z0-9_]/', '', $columnName);

Check failure on line 151 in src/Mapping/DefaultQuoteStrategy.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.3)

Equals sign not aligned with surrounding assignments; expected 8 spaces but found 2 spaces
$columnName = is_numeric($columnName) ? '_' . $columnName : $columnName;
if (!ctype_alpha($columnName[0]))

Check failure on line 152 in src/Mapping/DefaultQuoteStrategy.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.3)

Inline control structures are not allowed

Check failure on line 152 in src/Mapping/DefaultQuoteStrategy.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.3)

Expected 1 space(s) after NOT operator; 0 found

Check failure on line 152 in src/Mapping/DefaultQuoteStrategy.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.3)

Function ctype_alpha() should not be referenced via a fallback global name, but via a use statement.
$columnName[0] = 'C';

return $this->getSQLResultCasing($platform, $columnName);
}
Expand Down
Loading