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

Remove schema visitors #11001

Merged
merged 1 commit into from
Oct 12, 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
11 changes: 0 additions & 11 deletions lib/Doctrine/ORM/Tools/SchemaTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\AssociationMapping;
use Doctrine\ORM\Mapping\ClassMetadata;
Expand All @@ -33,13 +32,11 @@
use function array_flip;
use function array_intersect_key;
use function assert;
use function class_exists;
use function count;
use function current;
use function implode;
use function in_array;
use function is_numeric;
use function method_exists;
use function strtolower;

/**
Expand Down Expand Up @@ -381,14 +378,6 @@ public function getSchemaFromMetadata(array $classes): Schema
}
}

if (
! $this->platform->supportsSchemas()
&& class_exists(RemoveNamespacedAssets::class)
&& method_exists($schema, 'visit')
) {
$schema->visit(new RemoveNamespacedAssets());
}

if ($eventManager->hasListeners(ToolEvents::postGenerateSchema)) {
$eventManager->dispatchEvent(
ToolEvents::postGenerateSchema,
Expand Down
5 changes: 0 additions & 5 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<!-- We wire the command as long as DBAL ships it -->
<referencedClass name="Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand" />
<!-- Remove on 3.0.x -->
<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\AnnotationDriver"/>
Expand All @@ -47,7 +46,6 @@
<!-- Remove on 3.0.x -->
<!-- Compatibility with DBAL 3 -->
<referencedMethod name="Doctrine\DBAL\Connection::getEventManager"/>
<referencedMethod name="Doctrine\DBAL\Schema\Schema::visit"/>
<file name="lib/Doctrine/ORM/Query/TreeWalkerChain.php"/>
</errorLevel>
</DeprecatedMethod>
Expand Down Expand Up @@ -196,9 +194,6 @@
<errorLevel type="suppress">
<!-- Persistence 2 compatibility -->
<referencedClass name="Doctrine\Persistence\ObjectManagerAware"/>

<!-- See https://github.com/doctrine/dbal/pull/5432 -->
<referencedClass name="Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"/>
</errorLevel>
</UndefinedClass>
<UndefinedMethod>
Expand Down