laminas / laminas-diactoros

PSR HTTP Message implementations
https://docs.laminas.dev/laminas-diactoros/
BSD 3-Clause "New" or "Revised" License
487 stars 63 forks source link

Remove support for GD images in Stream implementation #148

Closed weierophinney closed 1 year ago

weierophinney commented 1 year ago
Q A
Documentation no
Bugfix yes
BC Break yes
New Feature no
RFC no
QA no

Description

GdImage-backed Stream instances have evidently never worked, but feature removal needs to happen in a new major.

See #57, #134, and #147 for full details behind removal.

weierophinney commented 1 year ago

Should we re-introduce the stream compat check in StreamFactory as it was removed in https://github.com/laminas/laminas-diactoros/pull/45/files#diff-565876e19198a94175bb659207c750dcb80cbbfa104490c6fad5322dd05d5febL49-L53 or do we verify that by waiting for the check in __construct => setStream of Stream#__construct?

It's stil there, just done in a different way. In isValidStreamResourceType, we check to see if (a) we have a resource, and (b) if it's in the list defined by the class constant ALLOWED_STREAM_RESOURCE_TYPES... which now only defines stream as a valid resource type.

Keeping it this way allows us to more easily expand it in the future, and keeps the same check that we had prior to adding GD support anyways.

boesing commented 1 year ago

It's stil there, just done in a different way.

StreamFactory validates valid resource type by counting on Stream#__construct to validate resource. So yes, it is there, but its more implicit than explicit.

That was what I wanted to clarify. If we are happy with implicit validation, thats okay for me as well.

Xerkus commented 1 year ago

I would like mentions of GD removed from documentation in v2 folder too so it won't be on live site anymore when this is released since it never worked.

weierophinney commented 1 year ago

I would like mentions of GD removed from documentation in v2 folder too so it won't be on live site anymore when this is released since it never worked.

Done.

Xerkus commented 1 year ago

Thank you!