Skip to content

Add final modifier to classes not designed for extension (#44)#118

Merged
s2x merged 3 commits intomasterfrom
fix/44-inconsistent-final-readonly
Apr 12, 2026
Merged

Add final modifier to classes not designed for extension (#44)#118
s2x merged 3 commits intomasterfrom
fix/44-inconsistent-final-readonly

Conversation

@s2x
Copy link
Copy Markdown
Collaborator

@s2x s2x commented Apr 12, 2026

Summary

  • Add final modifier to SymfonyController, StaticFilesMiddleware, and RequestConverter
  • These classes are not designed for extension

Closes #44

- SymfonyController
- StaticFilesMiddleware
- RequestConverter

Closes #44
@s2x
Copy link
Copy Markdown
Collaborator Author

s2x commented Apr 12, 2026

Code Review: Additional Classes Not Marked as final

I reviewed the current PR changes and compared them against the rest of the codebase. The 3 classes in this PR are correctly marked as final. ✅

However, there are 3 additional classes that could also be marked as final but were left untouched:

Safe to mark as final:

  • src/Reboot/Strategy/MemoryRebootStrategy.php — implements interface, no subclasses
  • src/Command/WorkermanCommand.php — extends Symfony Command, not designed for extension
  • src/Exception/NoResponseStrategyException.php — extends \LogicException, no subclasses

Not recommended to mark as final:

  • src/Http/Request.php — extends Workerman Request, may be extended by users
  • src/Runtime.php — extends SymfonyRuntime, commonly extended for custom runtime behavior
  • src/Protocol/Http/Response/StreamedBinaryFileResponse.php — extends Symfony BinaryFileResponse, may be extended

Suggestion

Consider adding final to the 3 safe classes above for consistency. Would you like me to push a follow-up commit?

Piotr Hałas added 2 commits April 12, 2026 11:44
- MemoryRebootStrategy
- WorkermanCommand
- NoResponseStrategyException

Address PR feedback
@s2x s2x merged commit 05680c0 into master Apr 12, 2026
21 checks passed
@s2x s2x deleted the fix/44-inconsistent-final-readonly branch April 12, 2026 09:50
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.

Inconsistent use of final/readonly in classes

1 participant