Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/updates (mainly support for psr/container ^2.0) #17

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

leonboot
Copy link

@leonboot leonboot commented Oct 5, 2023

Hi!

I'm offering this pull request, because I tried to install the slack-php-app-framework package to a recent Symfony project, and it failed because of the psr/container requirement that was pinned to ^1.0. Modern Symfony versions only support ^2.0, which makes it impossible to install. As the 2.0 version of psr/container still has the same implementation of the PSR-11 standard, there is no reason to add it to the requirements in this project's composer.json.

While adding ^2.0 to the composer.json, I noticed that the installed version in the vendor directory was not bumped and remained on the ^1.0 version. This was due to the friendsofphp/php-cs-fixer dev-requirement, which depends on an older version of symfony/contracts, which in turn requires psr/container ^1.0. By moving this dev-dependency to a separate composer.json (as recommended in the README of php-cs-fixer). I also moved the phpstan and phpunit packages to this separate composer.json, for consistency. I updated the scripts section of the root composer.json and the GitHub actions definition accordingly. The only thing that is different for running tests locally, is that you'll need to run composer install --working=dir=tools first, in order to install php-cs-fixer, phpunit and phpstan.

I also removed the root composer.lock, as this has no purpose for package projects. It will only fix package versions used when testing your code, which is not desirable.

FInally, I updated the GitHub actions configuration to run the tests on any branch, as I wanted to see the test results of my changes in my feature branch as well :-)

So, effectively this PR:

  • allows the package to be installed in recent projects, that, through other dependencies, do not allow for psr/container ^1.0 to be installed
  • Slightly changes the CI process, but effectively should still function like it did before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant