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

Add support for Composer ^2.0 #68

Merged
merged 3 commits into from
Apr 27, 2020
Merged

Add support for Composer ^2.0 #68

merged 3 commits into from
Apr 27, 2020

Conversation

jeromegamez
Copy link
Contributor

@jeromegamez jeromegamez commented Apr 26, 2020

Closes #67, supersedes #61


Greetings 👋,

I love your package and use it ev.ery.where, thank you so much for it!

Since I'd like to check out the upcoming Composer 2.0 release, this PR aims to add support for it. I tried to be as unobtrusive with my changes as possible, but also thought that this might be an opportunity to add some other updates.

Notable changes

Composer ^2.0

The plugin was pretty much 2.0-ready already 🥳, only the tests needed some adaptions. The Plugin now has empty deactivate() and uninstall() methods, and I wasn't able to figure out what to fill them with 🤷‍♂️.

PHP CS Fixer ^2.16

I had to remove the dev-dependency because PHP CS Fixer is currently limited to composer/semver: ^1.4.

Once PHP-CS-Fixer/PHP-CS-Fixer#4935 is addressed, it could be added back, but in the meantime, this is resolved on Travis CI with an ad-hoc download of the PHAR, and locally e.g. with a composer global require friendsofphp/php-cs-fixer

PHPUnit ^7.5

I added : void to the setUp() and tearDown() methods to ease the migration path to PHPUnit 8/9.

There was a mixture of $this->assert* and static::assert*, so I unified all calls to use $this (just my personal preference 😅)

@expectException* annotations have been deprecated, so I replaced them with $this->expectException*


I hope that the changes meet with your approval, and I'm looking forward to your review! 🌺

:octocat:

@pyrech
Copy link
Owner

pyrech commented Apr 27, 2020

Thank you so much for taking some time to update this library (PR is really well described, thanks!!) 😍

Concerning $this->assert VS self::assert I would have preferred the latest version as assert methods are in fact static but a not a big deal. Most PHP devs use the former and I can live with it 😄

Let's merge this PR. I guess I can release that as a patch version (aka 1.7.1) as there is no BC break, nor new feature.

Thanks again!

@pyrech pyrech merged commit 413eab0 into pyrech:master Apr 27, 2020
@pyrech pyrech mentioned this pull request Apr 27, 2020
@jeromegamez
Copy link
Contributor Author

Nice!! Thank you for reviewing and merging so quickly! 🥰

@jeromegamez jeromegamez deleted the composer-2 branch April 27, 2020 14:38
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.

Update to Composer 2
2 participants