Comments (3)
Thing is, you can't always use decoration to change behaviour in a meaningful way, without re-implementing. In a perfect world, that would be great. But we don't write perfect code, and therefore I feel it is unfair to prevent users from adapting code to their needs. Also, and this is my opinion, making things explicitly final
violates OCP.
from psr7.
You should use decorators instead of extending the classes:
https://github.com/getgrav/grav/tree/develop/system/src/Grav/Framework/Psr7/Traits
https://github.com/getgrav/grav/tree/develop/system/src/Grav/Framework/Psr7 (ignore AbstractUri, it's deprecated)
from psr7.
These are excellent questions. This has been discussed in lengths at #31.
I know that this library is forcing people to write good code and not to be lazy. I know that it is frustrating. I have not yet seen an argument based on computer science that show that the classes should not be final.
Also, and this is my opinion, making things explicitly final violates OCP.
I see that this is your opinion. But that opinion has no support in the definition of polymorphic open-closed principle. =)
You have to consider the "module" to be the PSR-7 specification together with this implementation.
from psr7.
Related Issues (20)
- Broken PSR-7 immutability HOT 2
- argument name of withHeader() is inconsistent with PSR-7 definition. HOT 2
- feature request for a non-buffered stream (NonBufferedStream) HOT 3
- Empty body when using psr17factory's createRequest HOT 3
- Filter Uri->withUserInfo() input HOT 2
- Axios get request gives [AxiosError:Network Error] & Error: header name must be a non-empty string
- Response::__toString() HOT 2
- Integration tests errors HOT 2
- Escaping of user info breaks NTLM authentication HOT 9
- "Site not found" for https://tnyholm.se HOT 2
- psr/http-message 版本问题 HOT 4
- PSR/HTTP message incompatibility 2.0 on nyholm/psr7 server HOT 1
- Breaking change from 1.5.1 => 1.6.0 due to fseek on new streams? HOT 3
- https://packagist.org/packages/php-http/message-factory dependand package abandoned HOT 1
- Segmentation Error while using Elasticsearch php's library bulk method HOT 2
- php-http/message-factory HOT 2
- Empty host value not allowed HOT 1
- For what reason message trait contains original header names?
- Support for "Early Hints" / HTTP Code 103 HOT 1
- Request getSize() returns null for php://input stream HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psr7.