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

Refactor ConnectionFactory to Use Match Expression #52

Merged
merged 4 commits into from
Nov 19, 2023
Merged

Refactor ConnectionFactory to Use Match Expression #52

merged 4 commits into from
Nov 19, 2023

Conversation

usermp
Copy link
Contributor

@usermp usermp commented Nov 11, 2023

Refactor ConnectionFactory to Use Match Expression

In this commit, I refactored the ConnectionFactory class to use the new match expression introduced in PHP 8.0. This simplifies the code and makes it more concise.

Changes made:

  • Updated the method signature of createConnection to specify the return type based on the driver.
  • Replaced the switch statement with a match expression for driver-based instance creation.
  • Removed unnecessary comments (@codeCoverageIgnore) as they are no longer needed with the match expression.

This refactor improves code readability and maintainability.

@staudenmeir
Copy link
Owner

staudenmeir commented Nov 14, 2023

Hi @usermp,
Thanks, I'll take a look.

@usermp
Copy link
Contributor Author

usermp commented Nov 15, 2023

Hi @usermp, Thanks, I'll take a look.
you're welcome!

@staudenmeir staudenmeir merged commit fbfb997 into staudenmeir:master Nov 19, 2023
38 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.

2 participants