⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.45
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
shopware
/
vendor
/
nyholm
/
psr7
/
doc
/
Edit File: final.md
# 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.
Simpan