vitorccs / laravel-csv

PHP Laravel package to export and import CSV files in a memory-optimized way
MIT License
26 stars 5 forks source link

Restore support for PHP 7.4 #6

Closed Xint0-elab closed 1 year ago

Xint0-elab commented 1 year ago

@vitorccs would you consider restoring support for PHP 7.4?

vitorccs commented 1 year ago

Hi @Xint0-elab In order to restore support for PHP 7.4, you may want to clone this repo and remove the "mixed" type from both

https://github.com/vitorccs/laravel-csv/blob/31f0cff5c2b6cd2daddbad3ceb57c2c3b56036e0/src/Services/Writer.php#L105 https://github.com/vitorccs/laravel-csv/blob/31f0cff5c2b6cd2daddbad3ceb57c2c3b56036e0/src/Services/Writer.php#L140

I have added some unit tests which requires PHP 8.x, e.g: https://github.com/vitorccs/laravel-csv/blob/31f0cff5c2b6cd2daddbad3ceb57c2c3b56036e0/tests/Services/ExportableServiceTest.php#L173

Xint0-elab commented 1 year ago

Since this is a breaking change I would suggest incrementing the major version to 2.0 for removing support for PHP 7.4; and keep support for PHP 7.4 in version 1.x.

vitorccs commented 1 year ago

Hi @Xint0-elab, most packages like Zend Framework and Doctrine increment the MINOR version - see below

https://medium.com/@sampart/semantic-versioning-when-you-change-the-required-programming-language-version-16a3a3555c95

If you still want to keep compatibility with PHP 7.4, you can create a PR which addresses both code changes I mentioned above and we could release under v1.0.1

So v1.1.0 => Add Lazy Support + PHP 8 v1.0.1 => Add Lazy Support (PHP 7.4) v1.0.0 => The main version (PHP 7.4)

Xint0-elab commented 1 year ago

OK, could you please create branch 1.0.x so I can make a pull-request to that branch with the changes?

vitorccs commented 1 year ago

Hi @Xint0-elab here is the v1.0.1 https://github.com/vitorccs/laravel-csv/tree/v1.0.1

Can you please check before we make a new release?

Xint0-elab commented 1 year ago

I already had the changes ready for making the PR just needed a separate base branch to not overwrite trunk. The PR is #7

vitorccs commented 1 year ago

@Xint0-elab Release published. Thx for your help.

Xint0-elab commented 1 year ago

@vitorccs thank you!