ramsey / conventional-commits

:yo_yo: A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook plugin!
MIT License
182 stars 21 forks source link

CaptainHook plugin is broken with symfony 6 #39

Closed diego-ninja closed 2 years ago

diego-ninja commented 2 years ago

The CaptainHook plugin don't work as expected when used with symfony 5 packages, the bug is related to the implementation of InputInterface in Ramsay\CaptainHook\Input.php, as the class is not defining return types in some functions that the interface does.

I just opened a pull request with the fix.

ramsey commented 2 years ago

Hi, thanks for submitting this!

Do you mean Symfony 5 or Symfony 6?

Here's what I see in Symfony 5: https://github.com/symfony/console/blob/6c6664efbf6fc5f22bc6cbcb03616dc7f1eb6e6f/Input/InputInterface.php#L29

And here's what I see in Symfony 6: https://github.com/symfony/console/blob/faf53e783e67847aff7de5ba73d9be76b7d4d65c/Input/InputInterface.php#L27

So, I think your changes are to support Symfony 6, right?

Unfortunately, this means that I'll have to drop Symfony 5 support, which might cause problems with others using this package. I'll need to give some thought to this.

diego-ninja commented 2 years ago

Yeah, I mean Symfony 6, sorry for the typo. I will modify pull request.

marek-mikula commented 2 years ago

@diego-ninja Hello,

I ran to the same problem today. I resolved the issue using patches in composer. Use this plugin https://github.com/cweagans/composer-patches and as a patch use your PR. I used it too and it works.

At least something before this issue gets resolved. :)

ramsey commented 2 years ago

Thanks for reporting. This is fixed in version 1.3.1.