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

Improve exception handling and code consistency #128

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

TavoNiievez
Copy link
Member

No description provided.

@TavoNiievez TavoNiievez requested a review from SamMousa February 26, 2025 17:13
Copy link
Collaborator

@SamMousa SamMousa left a comment

Choose a reason for hiding this comment

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

Reviewed from mobile, might not catch all.
Lgtm. I'd love a code sniffer rule for the import of global classes Vs the \xxx notation.

* Adds the required server params.
* Note this is done separately from the request cycle since someone might call
* `Url::to` before doing a request, which would instantiate the request component with incorrect server params.
* @return array<string, mixed>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't every value a string? We can be even more specific and use array shape.

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be, but it could be misconfigured.

Since it is possible to write any type of value in $this->config['entryScript'] and we are not validating the type of data received anywhere I get what you see in the screenshot.

imagen

I changed it to use array shape, I hope that's what you meant.

the port was returned manually as string, but from parse_url it is returned as int, let me know if you prefer an explicit cast to string (string) or if you are satisfied with string|int.

Copy link
Member

@Arhell Arhell left a comment

Choose a reason for hiding this comment

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

@samdark check please

@SamMousa
Copy link
Collaborator

Will review soon, reminder: use conventional commit messages. https://www.conventionalcommits.org/en/v1.0.0/

Otherwise automated releases won't work. For now I can fix it in the merge commit message.

@TavoNiievez TavoNiievez force-pushed the small-fixes branch 4 times, most recently from 5e0c782 to f9da3fe Compare February 28, 2025 17:53
@samdark
Copy link
Member

samdark commented Mar 1, 2025

Overall cosmetic changes with a few changes for behavior that I see as good ones 👍

     - Standardized `RuntimeException` usage by removing redundant namespace references.
     - Refactored `findAndLoginUser` for clarity using ternary assignment.
     - Used `readonly` property for `ignoreCollidingDSN` in `TransactionForcer`.
     - Optimized server params handling by introducing `getServerParams()`.
     - Improved configuration validation messages for clean and mail methods.
@SamMousa
Copy link
Collaborator

SamMousa commented Mar 2, 2025

LGTM

@SamMousa SamMousa merged commit a80a88a into Codeception:master Mar 2, 2025
2 checks passed
Copy link

github-actions bot commented Mar 2, 2025

🎉 This PR is included in version 2.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants