Skip to content

Commit d44323f

Browse files
authored
Merge pull request #7086 from morozov/remove-is-quoted
Remove AbstractAsset::isQuoted()
2 parents 5f90dbf + 5382ff0 commit d44323f

File tree

6 files changed

+5
-81
lines changed

6 files changed

+5
-81
lines changed

UPGRADE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ awareness about deprecated code.
88

99
# Upgrade to 5.0
1010

11+
## BC BREAK: Removed `AbstractAsset::isQuoted()`
12+
13+
The `AbstractAsset::isQuoted()` method has been removed.
14+
1115
## BC BREAK: Removed support for the `service` connection parameter.
1216

1317
The `service` parameter of the `oci8` and `pdo_oci` connections is no longer supported.

src/Platforms/OraclePlatform.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
use function sprintf;
3434
use function str_contains;
3535
use function strlen;
36-
use function strtoupper;
3736
use function substr;
3837

3938
/**
@@ -309,9 +308,7 @@ public function getListDatabasesSQL(): string
309308
public function getListSequencesSQL(string $database): string
310309
{
311310
return 'SELECT SEQUENCE_NAME, MIN_VALUE, INCREMENT_BY FROM SYS.ALL_SEQUENCES WHERE SEQUENCE_OWNER = '
312-
. $this->quoteStringLiteral(
313-
$this->normalizeIdentifier($database)->getName(),
314-
);
311+
. $this->quoteStringLiteral($database);
315312
}
316313

317314
/**
@@ -434,21 +431,6 @@ public function getDropAutoincrementSql(OptionallyQualifiedName $tableName): arr
434431
];
435432
}
436433

437-
/**
438-
* Normalizes the given identifier.
439-
*
440-
* Uppercases the given identifier if it is not quoted by intention
441-
* to reflect Oracle's internal auto uppercasing strategy of unquoted identifiers.
442-
*
443-
* @param string $name The identifier to normalize.
444-
*/
445-
private function normalizeIdentifier(string $name): Identifier
446-
{
447-
$identifier = new Identifier($name);
448-
449-
return $identifier->isQuoted() ? $identifier : new Identifier(strtoupper($name));
450-
}
451-
452434
/**
453435
* Adds suffix to identifier,
454436
*

src/Schema/AbstractAsset.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Doctrine\DBAL\Schema\Name\OptionallyQualifiedName;
1212
use Doctrine\DBAL\Schema\Name\Parser;
1313
use Doctrine\DBAL\Schema\Name\UnqualifiedName;
14-
use Doctrine\Deprecations\Deprecation;
1514

1615
use function array_map;
1716
use function assert;
@@ -111,27 +110,6 @@ protected function setName(?Name $name): void
111110
throw NotImplemented::fromMethod(static::class, __FUNCTION__);
112111
}
113112

114-
/**
115-
* Checks if this asset's name is quoted.
116-
*
117-
* @deprecated Depending on the concrete class of the object, use {@see NamedObject::getObjectName()} or
118-
* {@see OptionallyNamedObject::getObjectName()} to get the name. Then, depending on the type of the
119-
* name, use {@see UnqualifiedName::getIdentifier()}, {@see OptionallyQualifiedName::getQualifier()},
120-
* or {@see OptionallyQualifiedName::getUnqualifiedName()} to get the corresponding identifiers. Then,
121-
* use {@see Identifier::$isQuoted()}.
122-
*/
123-
public function isQuoted(): bool
124-
{
125-
Deprecation::triggerIfCalledFromOutside(
126-
'doctrine/dbal',
127-
'https://github.com/doctrine/dbal/pull/7084',
128-
'%s is deprecated and will be removed in 5.0.',
129-
__METHOD__,
130-
);
131-
132-
return $this->_quoted;
133-
}
134-
135113
/**
136114
* Trim quotes from the identifier.
137115
*/

tests/Functional/Schema/PostgreSQLSchemaManagerTest.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,24 +179,6 @@ public function testListSameTableNameColumnsWithDifferentSchema(): void
179179
self::assertTrue($anotherSchemaTable->hasColumn('email'));
180180
}
181181

182-
public function testReturnQuotedAssets(): void
183-
{
184-
$this->connection->executeStatement('DROP TABLE IF EXISTS dbal91_something');
185-
186-
$sql = 'create table dbal91_something'
187-
. ' (id integer CONSTRAINT id_something PRIMARY KEY NOT NULL, "table" integer)';
188-
$this->connection->executeStatement($sql);
189-
190-
$sql = 'ALTER TABLE dbal91_something ADD CONSTRAINT something_input'
191-
. ' FOREIGN KEY( "table" ) REFERENCES dbal91_something ON UPDATE CASCADE;';
192-
$this->connection->executeStatement($sql);
193-
194-
$table = $this->schemaManager->introspectTable('dbal91_something');
195-
$column = $table->getColumn('table');
196-
197-
self::assertTrue($column->isQuoted());
198-
}
199-
200182
public function testDefaultValueCharacterVarying(): void
201183
{
202184
$testTable = Table::editor()

tests/Platforms/OraclePlatformTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ public function testQuotedTableNames(): void
513513
)
514514
->create();
515515

516-
self::assertTrue($table->isQuoted());
517516
self::assertEquals('test', $table->getName());
518517
self::assertEquals('"test"', $table->getObjectName()->toSQL($this->platform));
519518

tests/Schema/ColumnTest.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Doctrine\DBAL\Schema\Name\UnqualifiedName;
1616
use Doctrine\DBAL\Types\Type;
1717
use Doctrine\DBAL\Types\Types;
18-
use PHPUnit\Framework\Attributes\DataProvider;
1918
use PHPUnit\Framework\TestCase;
2019

2120
class ColumnTest extends TestCase
@@ -122,26 +121,6 @@ public function testQuotedColumnName(): void
122121
self::assertEquals('[bar]', $column->getObjectName()->toSQL($sqlServerPlatform));
123122
}
124123

125-
#[DataProvider('getIsQuoted')]
126-
public function testIsQuoted(string $columnName, bool $isQuoted): void
127-
{
128-
$type = Type::getType(Types::STRING);
129-
$column = new Column($columnName, $type);
130-
131-
self::assertSame($isQuoted, $column->isQuoted());
132-
}
133-
134-
/** @return mixed[][] */
135-
public static function getIsQuoted(): iterable
136-
{
137-
return [
138-
['bar', false],
139-
['`bar`', true],
140-
['"bar"', true],
141-
['[bar]', true],
142-
];
143-
}
144-
145124
public function testColumnComment(): void
146125
{
147126
$column = Column::editor()

0 commit comments

Comments
 (0)