Skip to content

Commit

Permalink
Restore compatibility with Doctrine DBAL version 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Feb 26, 2025
1 parent a5f3223 commit 3c42e75
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/symfony/src/Doctrine/Type/AttestedCredentialDataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Webauthn\Bundle\Doctrine\Type;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\JsonType;
use Doctrine\DBAL\Types\Type;
use Webauthn\AttestedCredentialData;

Expand Down Expand Up @@ -39,4 +40,13 @@ public function getName(): string
{
return 'attested_credential_data';
}

public function requiresSQLCommentHint(AbstractPlatform $platform): bool
{
if (method_exists(JsonType::class, 'requiresSQLCommentHint')) {
return (new JsonType())->requiresSQLCommentHint($platform);
}

return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Webauthn\Bundle\Doctrine\Type;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\JsonType;
use Doctrine\DBAL\Types\Type;
use Webauthn\PublicKeyCredentialDescriptor;

Expand Down Expand Up @@ -39,4 +40,13 @@ public function getName(): string
{
return 'public_key_credential_descriptor';
}

public function requiresSQLCommentHint(AbstractPlatform $platform): bool
{
if (method_exists(JsonType::class, 'requiresSQLCommentHint')) {
return (new JsonType())->requiresSQLCommentHint($platform);
}

return false;
}
}
10 changes: 10 additions & 0 deletions src/symfony/src/Doctrine/Type/TrustPathDataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Webauthn\Bundle\Doctrine\Type;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\JsonType;
use Doctrine\DBAL\Types\Type;
use Webauthn\TrustPath\TrustPath;

Expand Down Expand Up @@ -39,4 +40,13 @@ public function getName(): string
{
return 'trust_path';
}

public function requiresSQLCommentHint(AbstractPlatform $platform): bool
{
if (method_exists(JsonType::class, 'requiresSQLCommentHint')) {
return (new JsonType())->requiresSQLCommentHint($platform);
}

return false;
}
}

0 comments on commit 3c42e75

Please sign in to comment.