Skip to content

Commit

Permalink
Use JsonType instead of JsonArrayType (#14)
Browse files Browse the repository at this point in the history
* Use JsonType instead of JsonArrayType

To be compliant with Symfony 4.2 (and furthermore to avoid deprecation in Symfony5.0)

* Update .travis.yml
  • Loading branch information
midieuminable authored and boldtrn committed Oct 9, 2019
1 parent 548aae5 commit bef906f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: php

php:
- 5.5
- 7.3

addons:
postgresql: "9.4"
postgresql: "9.6"

before_script:
- psql -c 'create database jsonb_test;' -U postgres
Expand All @@ -14,4 +14,4 @@ script:
- phpunit

notifications:
email: [email protected]
email: [email protected]
12 changes: 10 additions & 2 deletions Types/JsonbArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
namespace Boldtrn\JsonbBundle\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\JsonArrayType;
use Doctrine\DBAL\Types\JsonType;

/**
* Array Type which can be used to generate jsonb arrays. It uses the Doctrine JsonArrayType
*
* @author Robin Boldt <[email protected]>
*/
class JsonbArrayType extends JsonArrayType
class JsonbArrayType extends JsonType
{
/**
* {@inheritdoc}
Expand All @@ -26,5 +26,13 @@ public function getName()
{
return 'jsonb';
}

/**
* {@inheritdoc}
*/
public function requiresSQLCommentHint(AbstractPlatform $platform)
{
return true;
}

}

0 comments on commit bef906f

Please sign in to comment.