laminas / laminas-escaper

Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs
https://docs.laminas.dev/laminas-escaper/
BSD 3-Clause "New" or "Revised" License
191 stars 20 forks source link

Stricter input/output type declaration, matching original type signatures from `2.0.0-beta5` release #23

Closed carnage closed 3 years ago

carnage commented 3 years ago

Signed-off-by: Carnage t.carnage@gmail.com

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

The introduction of strict types in the file heading is propagated to calling code as the required types are missing from the method signatures. This PR adds the types and resolves the BC break.

While adding types to the methods could be considered a BC break in itself, I cannot conceive of any sensible use case that this change would impact.

Ocramius commented 3 years ago

Marked for 2.8.0.

Effectively, this is an improvement that mitigates the problems found in #20, and if call-site consumers of the code use declare(strict_types=0) (equivalent to not declaring strict types), this fixes some issues for them.

In addition to that, I decided to not mark this as BC Break, since:

Ocramius commented 3 years ago

I'll merge this manually after having applied some cleanup operations (CS/QA checks, mostly)

Ocramius commented 3 years ago

Thanks @carnage!

hostep commented 3 years ago

Thanks @Ocramius & @carnage: I can confirm that version 2.8.0 fixes the problem in Magento. Thanks for the quick action! 🙂