Skip to content

Commit

Permalink
Add support to doctrine ORM 3 and drop support for Doctrin ORM 2
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Feb 4, 2024
1 parent 0c7805c commit d065c25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"ext-fileinfo": "*",
"akrabat/ip-address-middleware": "^2.1",
"cakephp/chronos": "^3.0.2",
"doctrine/orm": "^2.17",
"doctrine/orm": "^3.0",
"endroid/qr-code": "^4.8",
"fig/http-message-util": "^1.1",
"guzzlehttp/guzzle": "^7.8",
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/NoDbNameConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public function __invoke(ContainerInterface $container): Connection
$params = $conn->getParams();
unset($params['dbname']);

return new Connection($params, $conn->getDriver(), $conn->getConfiguration(), $em->getEventManager());
return new Connection($params, $conn->getDriver(), $conn->getConfiguration());
}
}
7 changes: 2 additions & 5 deletions src/Doctrine/Type/ChronosDateTimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\DateTimeImmutableType;
use Doctrine\DBAL\Types\Exception\InvalidType;

class ChronosDateTimeType extends DateTimeImmutableType
{
Expand Down Expand Up @@ -48,10 +49,6 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
return $value->format($platform->getDateTimeFormatString());
}

throw ConversionException::conversionFailedInvalidType(
$value,
$this->getName(),
['null', DateTimeInterface::class],
);
throw InvalidType::new($value, $this->getName(), ['null', DateTimeInterface::class]);
}
}

0 comments on commit d065c25

Please sign in to comment.