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

Specify return type error #94

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Specify return type error #94

wants to merge 12 commits into from

Conversation

xepozz
Copy link
Contributor

@xepozz xepozz commented Feb 18, 2024

Q A
Is bugfix? ✔️
New feature?
Breaks BC? ✔️

Copy link

codecov bot commented Feb 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a80e629) 100.00% compared to head (c26b392) 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##              master       #94   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        91       103   +12     
===========================================
  Files              7        11    +4     
  Lines            239       290   +51     
===========================================
+ Hits             239       290   +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

what-the-diff bot commented Feb 18, 2024

PR Summary

  • Implementation of Exception for Invalid Middleware Return Types
    A new file named InvalidMiddlewareReturnTypeException.php was introduced which behaves as an alarm system if the return types from the middleware are incorrect.

  • Creation of Two Helper Classes

    • The new DefinitionHelper.php file contains methods which support in managing middleware definitions.
    • Another file ResponseHelper.php was also introduced which houses methods that aid with responses from the middleware.
  • Organizational Changes to Existing Files

    • The InvalidMiddlewareDefinitionException.php file has been rearranged. Two methods previously present here, convertDefinitionToString() and convertToString(), have now been relocated to the newly created helper classes discussed above.
    • Additionally, there's an update in the MiddlewareFactory.php file. The process() method now localizes a different kind of system exception - InvalidMiddlewareReturnTypeException, if conditions are met. This method previously used to detect InvalidMiddlewareDefinitionException.
  • Inclusion of Tests for New Additions

    • The newly introduced exception and helper files would be put to test with the help of a couple new files. InvalidMiddlewareReturnTypeExceptionTest.php will verify the functionality of our new exception, whereas ResponseHelperTest.php confirms the working of the newly added helper class.
  • Updates to Test Cases

    • The test files InvalidMiddlewareDefinitionExceptionTest.php and MiddlewareFactoryTest.php have been modified to reflect recent changes made in their respective files. The modification ensures exceptions are accurately detected and error messages are updated to fit the latest changes made.

@vjik vjik added the status:under development Someone is working on a pull request. label Feb 18, 2024
@xepozz xepozz requested a review from a team February 21, 2024 20:59
@xepozz xepozz added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels Feb 21, 2024
Copy link
Member

@vjik vjik left a comment

Choose a reason for hiding this comment

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

Need line in changelog

Copy link
Member

Choose a reason for hiding this comment

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

This methods need for excpetion only. May be keep thier in AbstractInvalidMiddlewareException but change visibility from private to protected?

Copy link
Member

Choose a reason for hiding this comment

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

Need add solution for friendly exception also. Solution from AbstractInvalidMiddlewareException does not fit here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants