Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 827cb0c

Browse files
authored
Address DBAL 3.4 deprecations (doctrine#9969)
1 parent 4d19c0e commit 827cb0c

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@
3939
*/
4040
class DatabaseDriver implements MappingDriver
4141
{
42+
/**
43+
* Replacement for {@see Types::ARRAY}.
44+
*
45+
* To be removed as soon as support for DBAL 3 is dropped.
46+
*/
47+
private const ARRAY = 'array';
48+
49+
/**
50+
* Replacement for {@see Types::OBJECT}.
51+
*
52+
* To be removed as soon as support for DBAL 3 is dropped.
53+
*/
54+
private const OBJECT = 'object';
55+
4256
/**
4357
* Replacement for {@see Types::JSON_ARRAY}.
4458
*
@@ -414,11 +428,11 @@ private function buildFieldMapping(string $tableName, Column $column): array
414428

415429
// Type specific elements
416430
switch ($fieldMapping['type']) {
417-
case Types::ARRAY:
431+
case self::ARRAY:
418432
case Types::BLOB:
419433
case Types::GUID:
420434
case self::JSON_ARRAY:
421-
case Types::OBJECT:
435+
case self::OBJECT:
422436
case Types::SIMPLE_ARRAY:
423437
case Types::STRING:
424438
case Types::TEXT:

psalm.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
<referencedClass name="Doctrine\ORM\Cache\Exception\InvalidResultCacheDriver"/>
2727
<!-- We wire the command as long as DBAL ships it -->
2828
<referencedClass name="Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand" />
29-
<!-- Remove on 2.13.x -->
30-
<referencedClass name="Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"/>
3129
<!-- Remove on 3.0.x -->
3230
<referencedClass name="Doctrine\Common\Persistence\PersistentObject"/>
31+
<referencedClass name="Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"/>
3332
<referencedClass name="Doctrine\ORM\Event\LifecycleEventArgs"/>
3433
<referencedClass name="Doctrine\ORM\Exception\UnknownEntityNamespace"/>
3534
<referencedClass name="Doctrine\ORM\Mapping\Driver\YamlDriver"/>
@@ -49,8 +48,6 @@
4948
<file name="lib/Doctrine/ORM/Query/Parser.php"/>
5049
<file name="lib/Doctrine/ORM/QueryBuilder.php"/>
5150
<file name="lib/Doctrine/ORM/Tools/EntityGenerator.php"/>
52-
<!-- Remove on 2.13.x. -->
53-
<file name="lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php" />
5451
</errorLevel>
5552
</DeprecatedConstant>
5653
<DeprecatedInterface>
@@ -73,9 +70,8 @@
7370
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getGuidExpression"/>
7471
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::supportsForeignKeyConstraints"/>
7572
<referencedMethod name="Doctrine\DBAL\Types\Type::getName"/>
76-
<!-- Remove on 2.13.x -->
77-
<referencedMethod name="Doctrine\DBAL\Schema\Schema::visit"/>
7873
<!-- Remove on 3.0.x -->
74+
<referencedMethod name="Doctrine\DBAL\Schema\Schema::visit"/>
7975
<referencedMethod name="Doctrine\ORM\Internal\Hydration\AbstractHydrator::hydrateRow"/>
8076
<referencedMethod name="Doctrine\ORM\Configuration::ensureProductionSettings"/>
8177
<referencedMethod name="Doctrine\ORM\Configuration::newDefaultAnnotationDriver"/>

0 commit comments

Comments
 (0)