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] Compatibility with PHP 7.3+ and Composer 2.0 #1

Merged
merged 7 commits into from Jan 12, 2021

Conversation

eliashaeussler
Copy link
Member

This PR includes:

  • Compatibility with PHP 7.3, 7.4 & 8.0 as well as Composer 2.0
  • Replacement of var_export by serialize() for the generated BundleDescriber class to avoid circular references
  • Support for GitHub actions as possible replacement for Travis CI

⚠️ Since extensive adaptions were made, this PR comes as breaking change for the current code base.

Version matrix

PHP 8.0 PHP 7.4 PHP 7.3 PHP 7.2 PHP 7.1
Composer 1.x 0.5.x 0.5.x 0.5.x 0.1.0 - 0.5.x 0.1.0 - 0.5.x
Composer 2.x 0.5.x 0.5.x 0.5.x 0.5.x 0.5.x

The support for various versions is possible because ocramius/package-versions is now replaced by composer/package-versions-deprecated which does exactly the same besides the fact that it supports a wider range of platform versions.

However, we should keep in mind that the packages' name describes the actual state of the package: it's deprecated (but still supported). I'd suggest to keep it for now and remove the dependency once Composer 2.x has became established. We can then focus on the class generation provided by Composer.

Serialization

Since var_export cannot handle circular references (which is the case for the currently used installed packages objects), an alternative needed to be found. It turned out that serialization might be a good choice for now as it store the whole object/array representation and is also able to handle circular references.

As a result, var_export has now been replaced by serialize(). The PropertyTrait and InstalledPackagesTrait have been adapted to resolve all serialized occurrences on first access.

GitHub actions

This project now supports GitHub actions next to Travis CI. It would be great if we can get rid of Travis CI if it turns out that GitHub actions fulfill all our requirements:

  • Test all supported combinations of PHP & Composer versions
  • Collect test results and send them to SonarCloud

@eliashaeussler eliashaeussler added the enhancement New feature or request label Jan 11, 2021
@sonarcloud
Copy link

sonarcloud bot commented Jan 11, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@dwenzel dwenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eliashaeussler Thank you so much. This is a great pull request!

Would you please comment on the usage of TestApplicationTrait?

tests/Unit/TestApplicationTrait.php Show resolved Hide resolved
@dwenzel dwenzel merged commit ce037e2 into develop Jan 12, 2021
@eliashaeussler eliashaeussler deleted the feature/php7.4-compatibility branch January 13, 2021 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants