File tree Expand file tree Collapse file tree 4 files changed +25
-10
lines changed
Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ matrix:
1919 env : PACKAGES='symfony/symfony=4.0.*'
2020 - php : 7.1
2121 env : PACKAGES='symfony/symfony=4.1.*'
22+ - php : 7.3
23+ env : PACKAGES='symfony/symfony=5.* doctrine/dbal=2.10'
2224
2325before_install :
2426 - travis_retry composer self-update
Original file line number Diff line number Diff line change 1313 "require" : {
1414 "php" : " ^7.1" ,
1515 "paillechat/php-enum" : " ^1.2 || ^2.1" ,
16- "symfony/http-kernel" : " ^3.4 || ^4.0" ,
17- "symfony/dependency-injection" : " ^3.4 || ^4.0" ,
18- "symfony/config" : " ^3.4 || ^4.0" ,
16+ "symfony/http-kernel" : " ^3.4 || ^4.0 || ^5.0 " ,
17+ "symfony/dependency-injection" : " ^3.4 || ^4.0 || ^5.0 " ,
18+ "symfony/config" : " ^3.4 || ^4.0 || ^5.0 " ,
1919 "doctrine/dbal" : " ^2.4"
2020 },
2121 "require-dev" : {
2222 "phpunit/phpunit" : " ^7.0" ,
23- "symfony/yaml" : " ^3.4 || ^4.0"
23+ "symfony/yaml" : " ^3.4 || ^4.0 || ^5.0 "
2424 },
2525 "autoload" : {
2626 "psr-4" : {
Original file line number Diff line number Diff line change @@ -11,9 +11,14 @@ final class Configuration implements ConfigurationInterface
1111 /** {@inheritdoc} */
1212 public function getConfigTreeBuilder (): TreeBuilder
1313 {
14- $ builder = new TreeBuilder ();
15-
16- $ root = $ builder ->root ('lamoda_enum ' );
14+ $ name = 'lamoda_enum ' ;
15+ if (method_exists (TreeBuilder::class, 'root ' )) {
16+ $ builder = new TreeBuilder ();
17+ $ root = $ builder ->root ($ name );
18+ } else {
19+ $ builder = new TreeBuilder ($ name );
20+ $ root = $ builder ->getRootNode ();
21+ }
1722
1823 $ root ->children ()->booleanNode ('enum_name_type_mapping ' )
1924 ->defaultValue (false );
Original file line number Diff line number Diff line change 44
55use Doctrine \DBAL \Platforms \AbstractPlatform ;
66use Doctrine \DBAL \Types \Type ;
7+ use Doctrine \DBAL \Types \TypeRegistry ;
78use Lamoda \EnumBundle \DBAL \EnumType ;
89use Lamoda \EnumBundle \DBAL \EnumTypeInitializer ;
910use Lamoda \EnumBundle \Naming \IdenticalNamingStrategy ;
@@ -23,9 +24,16 @@ protected function setUp(): void
2324 {
2425 $ typeReflectionClass = new \ReflectionClass (Type::class);
2526
26- $ typesMapProperty = $ typeReflectionClass ->getProperty ('_typesMap ' );
27- $ typesMapProperty ->setAccessible (true );
28- $ typesMapProperty ->setValue ([]);
27+ if ($ typeReflectionClass ->hasProperty ('_typesMap ' )) {
28+ $ typesMapProperty = $ typeReflectionClass ->getProperty ('_typesMap ' );
29+ $ typesMapProperty ->setAccessible (true );
30+ $ typesMapProperty ->setValue ([]);
31+ } else {
32+ $ registry = new TypeRegistry ();
33+ $ typesMapProperty = $ typeReflectionClass ->getProperty ('typeRegistry ' );
34+ $ typesMapProperty ->setAccessible (true );
35+ $ typesMapProperty ->setValue ($ registry );
36+ }
2937 }
3038
3139 public function testInitializerLoadsType (): void
You can’t perform that action at this time.
0 commit comments