for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2019 Spomky-Labs
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace OAuth2Framework\ServerBundle\Doctrine\Type;
use Assert\Assertion;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;
use OAuth2Framework\Component\RefreshTokenGrant\RefreshTokenId;
final class RefreshTokenIdType extends Type
{
/**
* {@inheritdoc}
public function convertToDatabaseValue($value, AbstractPlatform $platform): string
Assertion::isInstanceOf($value, RefreshTokenId::class, 'Invalid object');
return $value->getValue();
}
public function convertToPHPValue($value, AbstractPlatform $platform): RefreshTokenId
return new RefreshTokenId($value);
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string
return $platform->getClobTypeDeclarationSQL($fieldDeclaration);
public function getName(): string
return 'refresh_token_id';
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
return true;