HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/agile-selling-wpb/vendor/nyholm/psr7/doc/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.