Skip to content

Commit 3c42e75

Browse files
committed
Restore compatibility with Doctrine DBAL version 3
1 parent a5f3223 commit 3c42e75

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

src/symfony/src/Doctrine/Type/AttestedCredentialDataType.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Webauthn\Bundle\Doctrine\Type;
66

77
use Doctrine\DBAL\Platforms\AbstractPlatform;
8+
use Doctrine\DBAL\Types\JsonType;
89
use Doctrine\DBAL\Types\Type;
910
use Webauthn\AttestedCredentialData;
1011

@@ -39,4 +40,13 @@ public function getName(): string
3940
{
4041
return 'attested_credential_data';
4142
}
43+
44+
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
45+
{
46+
if (method_exists(JsonType::class, 'requiresSQLCommentHint')) {
47+
return (new JsonType())->requiresSQLCommentHint($platform);
48+
}
49+
50+
return false;
51+
}
4252
}

src/symfony/src/Doctrine/Type/PublicKeyCredentialDescriptorType.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Webauthn\Bundle\Doctrine\Type;
66

77
use Doctrine\DBAL\Platforms\AbstractPlatform;
8+
use Doctrine\DBAL\Types\JsonType;
89
use Doctrine\DBAL\Types\Type;
910
use Webauthn\PublicKeyCredentialDescriptor;
1011

@@ -39,4 +40,13 @@ public function getName(): string
3940
{
4041
return 'public_key_credential_descriptor';
4142
}
43+
44+
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
45+
{
46+
if (method_exists(JsonType::class, 'requiresSQLCommentHint')) {
47+
return (new JsonType())->requiresSQLCommentHint($platform);
48+
}
49+
50+
return false;
51+
}
4252
}

src/symfony/src/Doctrine/Type/TrustPathDataType.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Webauthn\Bundle\Doctrine\Type;
66

77
use Doctrine\DBAL\Platforms\AbstractPlatform;
8+
use Doctrine\DBAL\Types\JsonType;
89
use Doctrine\DBAL\Types\Type;
910
use Webauthn\TrustPath\TrustPath;
1011

@@ -39,4 +40,13 @@ public function getName(): string
3940
{
4041
return 'trust_path';
4142
}
43+
44+
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
45+
{
46+
if (method_exists(JsonType::class, 'requiresSQLCommentHint')) {
47+
return (new JsonType())->requiresSQLCommentHint($platform);
48+
}
49+
50+
return false;
51+
}
4252
}

0 commit comments

Comments
 (0)