tebru / gson-php

Gson implemented in PHP
Other
151 stars 18 forks source link

feat(cache): support multiple versions of symfony/cache #46

Closed Gounlaf closed 4 years ago

Gounlaf commented 4 years ago

Create a DefaultCacheProvider to create the appropriate instance of cache depending on symfony cache version. This is to support versions ^3.3|^4.0|^5.0 of symfony/cache (since 4.3, classes in Simple namespace are deprecated, and removed in 5.x)

Gounlaf commented 4 years ago

Hi @natebrunette, I'm doing this PR following update on tebru/doctrine-annotation-reader

I need your advice about tests: what I understand is that symfony/cache:^3.3 will be used on php 7.1, and symfony/cache:^5.0 on php 7.2 and 7.3. Maybe I should provide different version of GsonTest.php and configure phpunit to use the "correct" one according to php version?

Thanks,

Regards.

natebrunette commented 4 years ago

What is causing the test failures?

Gounlaf commented 4 years ago

Hi @natebrunette,

What is causing the test failures?

This line in travis config:

- if [ "$dependencies" = "lowest" ]; then composer update -o --prefer-lowest; fi;

Like I said above, I wanted to test all cases (symfon/cache 3, 4 and 5). But this line always install symfony/cache 3.

I don't know what the best ways to test against multiple versions of a dependency =/

natebrunette commented 4 years ago

Sorry, I still don't understand what's causing the failure. Does the code not work with that version of symfony cache?

Gounlaf commented 4 years ago

Sorry, I still don't understand what's causing the failure. Does the code not work with that version of symfony cache?

The tests doesn't work because I failed to configure correctly travis.

The code works. I test it locally with Docker on multiple php versions and multiple versions of the package symfony/cache.

natebrunette commented 4 years ago

I'm not sure what travis change is required, but please make that as well.

Gounlaf commented 4 years ago

I'm not sure what travis change is required, but please make that as well.

Ok I will try to figure it out

Gounlaf commented 4 years ago

@natebrunette should be ok now

natebrunette commented 4 years ago

@Gounlaf one small fix, then if you squash it looks good

Gounlaf commented 4 years ago

@Gounlaf one small fix, then if you squash it looks good

Squashed :)

Edit: next step : import these into tebru/retrofit :D

natebrunette commented 4 years ago

👍 thanks for your help