Skip to content

Commit

Permalink
Address DBAL 3.4 deprecations (#9969)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Aug 7, 2022
1 parent 4d19c0e commit 827cb0c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
18 changes: 16 additions & 2 deletions lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@
*/
class DatabaseDriver implements MappingDriver
{
/**
* Replacement for {@see Types::ARRAY}.
*
* To be removed as soon as support for DBAL 3 is dropped.
*/
private const ARRAY = 'array';

/**
* Replacement for {@see Types::OBJECT}.
*
* To be removed as soon as support for DBAL 3 is dropped.
*/
private const OBJECT = 'object';

/**
* Replacement for {@see Types::JSON_ARRAY}.
*
Expand Down Expand Up @@ -414,11 +428,11 @@ private function buildFieldMapping(string $tableName, Column $column): array

// Type specific elements
switch ($fieldMapping['type']) {
case Types::ARRAY:
case self::ARRAY:
case Types::BLOB:
case Types::GUID:
case self::JSON_ARRAY:
case Types::OBJECT:
case self::OBJECT:
case Types::SIMPLE_ARRAY:
case Types::STRING:
case Types::TEXT:
Expand Down
8 changes: 2 additions & 6 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
<referencedClass name="Doctrine\ORM\Cache\Exception\InvalidResultCacheDriver"/>
<!-- We wire the command as long as DBAL ships it -->
<referencedClass name="Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand" />
<!-- Remove on 2.13.x -->
<referencedClass name="Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"/>
<!-- Remove on 3.0.x -->
<referencedClass name="Doctrine\Common\Persistence\PersistentObject"/>
<referencedClass name="Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"/>
<referencedClass name="Doctrine\ORM\Event\LifecycleEventArgs"/>
<referencedClass name="Doctrine\ORM\Exception\UnknownEntityNamespace"/>
<referencedClass name="Doctrine\ORM\Mapping\Driver\YamlDriver"/>
Expand All @@ -49,8 +48,6 @@
<file name="lib/Doctrine/ORM/Query/Parser.php"/>
<file name="lib/Doctrine/ORM/QueryBuilder.php"/>
<file name="lib/Doctrine/ORM/Tools/EntityGenerator.php"/>
<!-- Remove on 2.13.x. -->
<file name="lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php" />
</errorLevel>
</DeprecatedConstant>
<DeprecatedInterface>
Expand All @@ -73,9 +70,8 @@
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getGuidExpression"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::supportsForeignKeyConstraints"/>
<referencedMethod name="Doctrine\DBAL\Types\Type::getName"/>
<!-- Remove on 2.13.x -->
<referencedMethod name="Doctrine\DBAL\Schema\Schema::visit"/>
<!-- Remove on 3.0.x -->
<referencedMethod name="Doctrine\DBAL\Schema\Schema::visit"/>
<referencedMethod name="Doctrine\ORM\Internal\Hydration\AbstractHydrator::hydrateRow"/>
<referencedMethod name="Doctrine\ORM\Configuration::ensureProductionSettings"/>
<referencedMethod name="Doctrine\ORM\Configuration::newDefaultAnnotationDriver"/>
Expand Down

0 comments on commit 827cb0c

Please sign in to comment.