Skip to content

Add support for Symfony 5#52

Open
ccjjmartin wants to merge 1 commit into
joachim-n:masterfrom
ccjjmartin:master
Open

Add support for Symfony 5#52
ccjjmartin wants to merge 1 commit into
joachim-n:masterfrom
ccjjmartin:master

Conversation

@ccjjmartin

@ccjjmartin ccjjmartin commented Jan 26, 2020

Copy link
Copy Markdown

Purpose:

  • When running composer install after a fresh clone down of the repository errors are thrown.

Fixes:

Solution:

  • Force fresh installs to use Symfony version less than 5.

@ccjjmartin

Copy link
Copy Markdown
Author

Fixes #51

@joachim-n

Copy link
Copy Markdown
Owner

Thanks for the PR!

Should we update this to work with Symfony 5 instead?

It's meant to run as a standalone thing, so there's no conflict with whatever Drupal is using.

@ccjjmartin

Copy link
Copy Markdown
Author

@joachim-n Maybe, my original thought is that this project would be consistent with the version of Symfony that Drupal supports. Currently Drupal 9 supports 4.x, looks like there is a desire to make it work with 5.x but we aren't there yet: https://www.drupal.org/project/drupal/issues/3055180

@ccjjmartin

Copy link
Copy Markdown
Author

@joachim-n Testing some changes to make it compatible anyway.

@ccjjmartin

Copy link
Copy Markdown
Author

Looks like some more changes are necessary to the other commands that are missing return statements. Example is the apply command, looking into it.

@joachim-n

Copy link
Copy Markdown
Owner

It looks like we just need to return a 0 status code from commands? If Symfony < 5 doesn't mind this, then it seems like an easy win.

You might want to make a different PR for this new approach though, rather than have the commits that change the composer.json kicking around.

Thanks for looking into this!

@ccjjmartin

Copy link
Copy Markdown
Author

Yeah, should be an easy win and won't break anything on less than Symfony 5. I will squash the commits once everything appears to be working.

@ccjjmartin

Copy link
Copy Markdown
Author

@joachim-n Ok, I squashed the commits and force pushed the changes to the branch on my fork so everything is cleaned up now.

I will say that of the commands I was able to test manually with the project I am working on everything appears to be functional. I would still recommend a power user checks these before merging:

  1. Before updating to Symfony 5, pull these changes down
  2. Verify all of the commands still function as expected with a Symfony version less than 5
  3. Run composer update locally and verify that Symfony 5.x gets installed
  4. Verify that with the new version of Symfony all of the commands still function as expected

When someone has a chance to test this I look forward to your feedback.

@ccjjmartin ccjjmartin changed the title Limit Symfony version to less than 5 Add support for Symfony 5 Jan 27, 2020
@mdlutz24

Copy link
Copy Markdown

This looks good to me, we had to do the same thing in core, because Symfony 4 started throwing deprecation errors if commands didn't return an int. I had considered creating a class constant to represent COMMAND_SUCCESS or something, but we return 0 in core and symfony returns 0, so I just stick with 0.

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.

Not compatible with Symfony 5

3 participants