CoreFiles by mySites.guru
final.md20 lines, 895 bytes, from Joomla_4.0.3-rc-Release_Candidate-Full_Package.zip
Raw History Compare with 4.0.0-rc6
md5
a2e514844e6d2855ba6a0a441e5d0253
sha1
3b410fd5d96475e67ebcbc50df9433b64c5529a8
sha256
7e0b8509a8f066d3dff4686bde26843e175183a2d13a80acf72f8fa94104f113
# Final classes

The `final` keyword was removed in version 1.4.0. It was replaced by `@final` annotation.
This was done due popular demand, not because it is a good technical reason to
extend the classes.

This document will show the correct way to work with PSR-7 classes. The "correct way"
refers to best practices and good software design. I strongly believe that one should
be aware of how a problem *should* be solved, however, it is not needed to always
implement that solution.

## Extending classes

You should never extend the classes, you should rather use composition or implement
the interface yourself. Please refer to the [decorator pattern](https://refactoring.guru/design-patterns/decorator).

## Mocking classes

The PSR-7 classes are all value objects and they can be used without mocking. If
one really needs to create a special scenario, one can mock the interface instead.

The same content is in 46 releases, Joomla 4.0.0-rc1 to 4.2.0-alpha2. See them all, or every version of this file.