Skip to content

Remove legacy code paths that rely on feature checks #61150

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

Merged
merged 1 commit into from
Jul 21, 2025
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
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"ext-xml": "*",
"doctrine/event-manager": "^2",
"doctrine/persistence": "^3.1|^4",
"twig/twig": "^3.12",
"twig/twig": "^3.21",
"psr/cache": "^2.0|^3.0",
"psr/clock": "^1.0",
"psr/container": "^1.1|^2.0",
Expand Down Expand Up @@ -133,8 +133,8 @@
"cache/integration-tests": "dev-master",
"doctrine/collections": "^1.8|^2.0",
"doctrine/data-fixtures": "^1.1",
"doctrine/dbal": "^3.6|^4",
"doctrine/orm": "^2.15|^3",
"doctrine/dbal": "^4.3",
"doctrine/orm": "^3.4",
"dragonmantank/cron-expression": "^3.1",
"egulias/email-validator": "^2.1.10|^3.1|^4",
"guzzlehttp/promises": "^1.4|^2.0",
Expand Down Expand Up @@ -171,8 +171,8 @@
"amphp/amp": "<3",
"async-aws/core": "<1.5",
"doctrine/collections": "<1.8",
"doctrine/dbal": "<3.6",
"doctrine/orm": "<2.15",
"doctrine/dbal": "<4.3",
"doctrine/orm": "<3.4",
"egulias/email-validator": "~3.0.0",
"masterminds/html5": "<2.6",
"phpdocumentor/reflection-docblock": "<5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function guessType(string $class, string $property): ?TypeGuess
}

return match ($metadata->getTypeOfField($property)) {
'array', // DBAL < 4
Types::SIMPLE_ARRAY => new TypeGuess(CollectionType::class, [], Guess::MEDIUM_CONFIDENCE),
Types::BOOLEAN => new TypeGuess(CheckboxType::class, [], Guess::HIGH_CONFIDENCE),
Types::DATETIME_MUTABLE,
Expand Down
9 changes: 0 additions & 9 deletions src/Symfony/Bridge/Doctrine/IdGenerator/UlidGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Bridge\Doctrine\IdGenerator;

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Id\AbstractIdGenerator;
use Symfony\Component\Uid\Factory\UlidFactory;
Expand All @@ -24,14 +23,6 @@ public function __construct(
) {
}

/**
* doctrine/orm < 2.11 BC layer.
*/
public function generate(EntityManager $em, $entity): Ulid
{
return $this->generateId($em, $entity);
}

public function generateId(EntityManagerInterface $em, $entity): Ulid
{
if ($this->factory) {
Expand Down
9 changes: 0 additions & 9 deletions src/Symfony/Bridge/Doctrine/IdGenerator/UuidGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Bridge\Doctrine\IdGenerator;

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Id\AbstractIdGenerator;
use Symfony\Component\Uid\Factory\NameBasedUuidFactory;
Expand All @@ -31,14 +30,6 @@ public function __construct(?UuidFactory $factory = null)
$this->protoFactory = $this->factory = $factory ?? new UuidFactory();
}

/**
* doctrine/orm < 2.11 BC layer.
*/
public function generate(EntityManager $em, $entity): Uuid
{
return $this->generateId($em, $entity);
}

public function generateId(EntityManagerInterface $em, $entity): Uuid
{
if (null !== $this->entityGetter) {
Expand Down
133 changes: 0 additions & 133 deletions src/Symfony/Bridge/Doctrine/Middleware/Debug/DBAL3/Connection.php

This file was deleted.

76 changes: 0 additions & 76 deletions src/Symfony/Bridge/Doctrine/Middleware/Debug/DBAL3/Statement.php

This file was deleted.

9 changes: 0 additions & 9 deletions src/Symfony/Bridge/Doctrine/Middleware/Debug/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ public function connect(array $params): ConnectionInterface
{
$connection = parent::connect($params);

if ('void' !== (string) (new \ReflectionMethod(ConnectionInterface::class, 'commit'))->getReturnType()) {
return new DBAL3\Connection(
$connection,
$this->debugDataHolder,
$this->stopwatch,
$this->connectionName
);
}

return new Connection(
$connection,
$this->debugDataHolder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bridge\Doctrine\PropertyInfo;

use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\BigIntType;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\AssociationMapping;
Expand Down Expand Up @@ -130,8 +129,7 @@ public function getType(string $class, string $property, array $context = []): ?

$nullable = $metadata instanceof ClassMetadata && $metadata->isNullable($property);

// DBAL 4 has a special fallback strategy for BINGINT (int -> string)
if (Types::BIGINT === $typeOfField && !method_exists(BigIntType::class, 'getName')) {
if (Types::BIGINT === $typeOfField) {
return $nullable ? Type::nullable(Type::union(Type::int(), Type::string())) : Type::union(Type::int(), Type::string());
}

Expand Down Expand Up @@ -231,7 +229,6 @@ private function getTypeIdentifier(string $doctrineType): ?TypeIdentifier
Types::BOOLEAN => TypeIdentifier::BOOL,
Types::BLOB,
Types::BINARY => TypeIdentifier::RESOURCE,
'object', // DBAL < 4
Types::DATE_MUTABLE,
Types::DATETIME_MUTABLE,
Types::DATETIMETZ_MUTABLE,
Expand All @@ -242,8 +239,6 @@ private function getTypeIdentifier(string $doctrineType): ?TypeIdentifier
Types::DATETIMETZ_IMMUTABLE,
Types::TIME_IMMUTABLE,
Types::DATEINTERVAL => TypeIdentifier::OBJECT,
'array', // DBAL < 4
'json_array', // DBAL < 3
Types::SIMPLE_ARRAY => TypeIdentifier::ARRAY,
default => null,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@ abstract public function postGenerateSchema(GenerateSchemaEventArgs $event): voi
protected function getIsSameDatabaseChecker(Connection $connection): \Closure
{
return static function (\Closure $exec) use ($connection): bool {
$schemaManager = method_exists($connection, 'createSchemaManager') ? $connection->createSchemaManager() : $connection->getSchemaManager();
$schemaManager = $connection->createSchemaManager();
$checkTable = 'schema_subscriber_check_'.bin2hex(random_bytes(7));
$table = new Table($checkTable);
$table->addColumn('id', Types::INTEGER)
->setAutoincrement(true)
->setNotnull(true);

if (class_exists(PrimaryKeyConstraint::class)) {
$table->addPrimaryKeyConstraint(new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('id'))], true));
} else {
$table->setPrimaryKey(['id']);
}
$table->addPrimaryKeyConstraint(new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('id'))], true));

$schemaManager->createTable($table);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ private function addTableToSchema(Schema $schema): void
$table->addColumn('class', Types::STRING, ['length' => 100]);
$table->addColumn('username', Types::STRING, ['length' => 200]);

if (class_exists(PrimaryKeyConstraint::class)) {
$table->addPrimaryKeyConstraint(new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('series'))], true));
} else {
$table->setPrimaryKey(['series']);
}
$table->addPrimaryKeyConstraint(new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('series'))], true));
}
}
Loading
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy