Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ParameterType::BINARY to UuidBinaryOrderedTimeType #72

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/UuidBinaryOrderedTimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace Ramsey\Uuid\Doctrine;

use Doctrine\DBAL\ParameterType;
Copy link
Sponsor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall fine to have this patch, but then we need to bump the minimum supported doctrine/dbal to ^3.

use InvalidArgumentException;
use Ramsey\Uuid\Codec\OrderedTimeCodec;
use Doctrine\DBAL\Types\ConversionException;
Expand Down Expand Up @@ -229,4 +230,14 @@ private function decode($bytes)

return $decoded;
}

/**
* @inheritdoc
*
* @return int
*/
public function getBindingType()
{
return ParameterType::BINARY;
}
}
5 changes: 5 additions & 0 deletions tests/UuidBinaryOrderedTimeTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ public function testRequiresSQLCommentHint()
$this->assertTrue($this->getType()->requiresSQLCommentHint($this->getPlatform()));
}

public function testItReturnsAppropriateBindingType()
{
$this->assertEquals(16, $this->getType()->getBindingType());
}

/**
* @return AbstractPlatform & MockInterface
*/
Expand Down