Skip to content

Commit

Permalink
avoid deprecation notices
Browse files Browse the repository at this point in the history
  • Loading branch information
craue committed Aug 23, 2023
1 parent 4019b44 commit aebd197
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Storage/DoctrineStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private function tableExists() {
private function createTable() {
// TODO remove as soon as Doctrine DBAL >= 3.0 is required
$stringType = defined('Doctrine\DBAL\Types\Types::STRING') ? Types::STRING : Type::STRING;
$arrayType = defined('Doctrine\DBAL\Types\Types::ARRAY') ? Types::ARRAY : Type::TARRAY;
$arrayType = defined('Doctrine\DBAL\Types\Types::JSON') ? Types::JSON : Type::TARRAY;

$table = new Table(self::TABLE, [
new Column($this->keyColumn, Type::getType($stringType)),
Expand Down
1 change: 1 addition & 0 deletions Tests/Storage/DoctrineStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class DoctrineStorageTest extends AbstractStorageTest {
* {@inheritDoc}
*/
protected function getStorageImplementation() {
// TODO remove $configuration variable as soon as DBAL >= 4 is required
$configuration = new Configuration();

if (\method_exists($configuration, 'setSchemaManagerFactory')) {
Expand Down
2 changes: 2 additions & 0 deletions Tests/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ framework:
router:
resource: '%kernel.project_dir%/Tests/config/routing.yml'
secret: whatever
session:
handler_id: ~
test: ~
translator:
fallback: en
Expand Down
31 changes: 28 additions & 3 deletions Tests/config/config_hacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,38 @@
],
]);

// TODO put back into config.yml as soon as Symfony >= 5.3 is required, see https://github.com/symfony/symfony/pull/41247
$container->loadFromExtension('security', Kernel::VERSION_ID >= 50300 ? [
// TODO clean up as soon as Symfony >= 5.3 is required, see https://github.com/symfony/symfony/pull/41247
// TODO remove as soon as Symfony >= 6.2 is required, see https://github.com/symfony/symfony/pull/47890
$container->loadFromExtension('security', Kernel::VERSION_ID >= 60200 ? [] : (Kernel::VERSION_ID >= 50300 ? [
'enable_authenticator_manager' => true,
] : [
'firewalls' => [
'dummy' => [
'anonymous' => true,
],
],
]);
]));

// TODO remove as soon as Symfony >= 7 is required, see https://github.com/symfony/symfony/blob/6.4/UPGRADE-6.4.md#frameworkbundle
if (Kernel::VERSION_ID >= 60400 && Kernel::VERSION_ID < 70000) {
$container->loadFromExtension('framework', [
'handle_all_throwables' => true,
'php_errors' => [
'log' => true,
],
'session' => [
'cookie_secure' => 'auto',
'cookie_samesite' => 'lax',
],
'validation' => [
'email_validation_mode' => 'html5',
],
]);
}

// TODO remove as soon as Symfony >= 7 is required, see https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.1.md#frameworkbundle
if (Kernel::VERSION_ID < 70000) {
$container->loadFromExtension('framework', [
'http_method_override' => false,
]);
}

0 comments on commit aebd197

Please sign in to comment.