Skip to content

Commit bef906f

Browse files
midieuminableboldtrn
authored andcommitted
Use JsonType instead of JsonArrayType (#14)
* Use JsonType instead of JsonArrayType To be compliant with Symfony 4.2 (and furthermore to avoid deprecation in Symfony5.0) * Update .travis.yml
1 parent 548aae5 commit bef906f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: php
22

33
php:
4-
- 5.5
4+
- 7.3
55

66
addons:
7-
postgresql: "9.4"
7+
postgresql: "9.6"
88

99
before_script:
1010
- psql -c 'create database jsonb_test;' -U postgres
@@ -14,4 +14,4 @@ script:
1414
- phpunit
1515

1616
notifications:
17-
email: boldtrn@gmail.com
17+
email: boldtrn@gmail.com

Types/JsonbArrayType.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
namespace Boldtrn\JsonbBundle\Types;
33

44
use Doctrine\DBAL\Platforms\AbstractPlatform;
5-
use Doctrine\DBAL\Types\JsonArrayType;
5+
use Doctrine\DBAL\Types\JsonType;
66

77
/**
88
* Array Type which can be used to generate jsonb arrays. It uses the Doctrine JsonArrayType
99
*
1010
* @author Robin Boldt <boldtrn@gmail.com>
1111
*/
12-
class JsonbArrayType extends JsonArrayType
12+
class JsonbArrayType extends JsonType
1313
{
1414
/**
1515
* {@inheritdoc}
@@ -26,5 +26,13 @@ public function getName()
2626
{
2727
return 'jsonb';
2828
}
29+
30+
/**
31+
* {@inheritdoc}
32+
*/
33+
public function requiresSQLCommentHint(AbstractPlatform $platform)
34+
{
35+
return true;
36+
}
2937

3038
}

0 commit comments

Comments
 (0)