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

Defining PHP 8.1 as base version #79

Merged
merged 10 commits into from
Oct 27, 2024
Merged

Defining PHP 8.1 as base version #79

merged 10 commits into from
Oct 27, 2024

Conversation

byjg
Copy link
Owner

@byjg byjg commented Jan 7, 2024

This pull request includes several updates to modernize the codebase, improve type safety, and enhance testing. Key changes involve updating PHP versions, adding Psalm for static analysis, renaming and adding new run configurations, and refactoring code to use stricter type declarations.

Updates to Testing and CI:

  • .github/workflows/phpunit.yml: Added PHP 8.3 to the test matrix and removed older versions (7.4, 8.0). Also added Psalm static analysis to the CI pipeline. [1] [2]
  • .travis.yml: Removed the Travis CI configuration in favor of GitHub Actions.

Configuration and Dependency Updates:

  • composer.json: Updated PHP requirement to >=8.1, updated dependencies to their latest versions, and added vimeo/psalm for static analysis. [1] [2]
  • psalm.xml: Added a new configuration file for Psalm static analysis.

Code Refactoring for Type Safety:

Documentation and Configuration:

These changes collectively enhance the project's compatibility with modern PHP versions, improve code quality through static analysis, and ensure better type safety across the codebase.

composer.json Outdated Show resolved Hide resolved
@vitormattos
Copy link
Contributor

vitormattos commented May 8, 2024

Worked fine to me.

composer.json Outdated
"byjg/webrequest": "4.9.*",
"php": ">=7.4",
"ext-json": "*"
"php": ">=8.1",

Choose a reason for hiding this comment

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

This constraint also allows version 8.4, but this version of PHP is not covered by the GitHub workflow.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I am going to upgrade the project https://github.com/byjg/docker-php to support PHP 8.4 since alpine:edge has the 8.4 beta already :)

Choose a reason for hiding this comment

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

The problem is different: this packages can be installed with version 8.4 of PHP but it is not tested with that version. This can therefore lead to problems on the user side, as PHP does not follow semantic versioning.
This would help:

"php": "~8.1.0 || ~8.2.0 || ~8.3.0",

https://getcomposer.org/doc/articles/versions.md

Copy link
Owner Author

Choose a reason for hiding this comment

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

Gotcha. I'll add this.

@byjg
Copy link
Owner Author

byjg commented Sep 16, 2024 via email

@byjg
Copy link
Owner Author

byjg commented Oct 27, 2024

I decided to limit the PHP Version explicitly to 8.3. I am creating a new official tag now.

@byjg byjg merged commit dfd9e6c into master Oct 27, 2024
4 checks passed
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.

3 participants