DavidePastore / Slim-Validation

A validation library for the Slim Framework. It internally uses Respect/Validation.
170 stars 30 forks source link

Slim4 Support w/ Test updates #61

Closed stephenkuhn214 closed 1 year ago

stephenkuhn214 commented 2 years ago

Update to use Slim version 4.

stephenkuhn214 commented 2 years ago

@DavidePastore anything else that needs to be done to this so it can be merged to allow for Slim4 compatibility?

travis-vandame commented 1 year ago

@DavidePastore @stephenkuhn214 Are there plans to get this merged in?

stephenkuhn214 commented 1 year ago

@travis-vandame I'm just waiting on @DavidePastore to approve and merge it.

DavidePastore commented 1 year ago

Hi @stephenkuhn214. Thank you for this PR! Could you please rebase it from the 4.0 branch? You can completely remove the composer.lock file since this is not required anymore (dependencies will be installed based on the PHP version the users are using).

stephenkuhn214 commented 1 year ago

@DavidePastore I've removed the composer.lock file, but I'm not sure how you want me to rebase my fork using your 4.0 branch. Do I need to for your 4.0 branch first and then rebase in my repo using that?

DavidePastore commented 1 year ago

@stephenkuhn214, I managed to fix some issues that we were facing. I tried to support older versions (PHP 7.1) of PHP but unfortunately, this is not possible because of the wrong usage of the provide section in composer.json in older versions of the slim/http package. We have two missing things:

stephenkuhn214 commented 1 year ago

@DavidePastore README has been updated to mention requiring Slim 4. I didn't see anything else in there that seemed to need updating. The PHPUnit config was updated to have that block per the requirements of PHPUnit 9.5. Looks like the build is using PHPUnit 8.5. Not sure how you want to proceed with differing xml configs between versions.

When running it locally for me, composer installed PHPUnit 9.5 even though it only requires ^8.0, so I had change the xml file to match my installation because it was failing. If we want to support PHPUnit 8, I can change the config file back, but it won't work for ^9.0.

DavidePastore commented 1 year ago

@stephenkuhn214, thank you for the additional update you did on the README.md file. What I can see is that the instructions you can find on the Slim 4 documentation are different than the ones that are stated in this branch README.md (e.g. how to instantiate the Slim application). Could you please fix it? Regarding the currently used PHPUnit version, it supports PHP 7.2. Are you sure that you removed the composer.lock file before launching composer install?

stephenkuhn214 commented 1 year ago

@DavidePastore README.md has been updated with the Slim4 app instantiation instructions. Sorry I missed that the first time! Regarding the PHPUnit version I was using, yes you're correct, it must have been because of composer.lock. Since that file is removed, I re-ran composer install and it installed PHPUnit 8.5 which works correctly now that you reverted my changes in the config file to use <filter> instead of <coverage>.

DavidePastore commented 1 year ago

Perfect @stephenkuhn214, thank you for the changes!

DavidePastore commented 1 year ago

Released here: https://github.com/DavidePastore/Slim-Validation/releases/tag/v4.0.0