brexis / laravel-workflow

Use the Symfony Workflow component in Laravel
MIT License
281 stars 105 forks source link

Package won't work with symfony/workflow < 4.1 #57

Open kblais opened 5 years ago

kblais commented 5 years ago

While trying to figure an issue I have with the package, I realized it can't work with symfony/workflow < 4.1 since 1.3.0 because of the use of InstanceOfSupportStrategy here : https://github.com/brexis/laravel-workflow/blob/f09800a55788f834a347e4c904a50d1c786a32f9/src/WorkflowRegistry.php#L78

This class was introduced in symfony/workflow 4.1 to replace the now-deprecated ClassInstanceSupportStrategy.

So either we define the minimum requirement to "symfony/worflow": "^4.1", or we add a compatibility layer to check if InstanceOfSupportStrategy exists, and if not use the ClassInstanceSupportStrategy.

What do you think about this ?

brexis commented 5 years ago

Yes, Use the previous versions before 1.3.0 for with Symfony Workflow < 4.1.

kblais commented 5 years ago

Well, then the composer.json should be updated to only use Symfony components >= 4.1, no ? Because right now, you can require the package, but it won't work (which is pretty frustrating when you think about it)