The introduction of declare(strict_types=1); made the change backwards incompatible with systems using laminas/laminas-escaper as a dependency in a non-strict way. For example Magento: https://github.com/magento/magento2/issues/33346
Don't get me wrong - it's an absolutely great idea to use strict types everywhere. But because of backwards incompatibility reasons, it shouldn't be enforced in a patch version increase (2.7.0 -> 2.7.1).
Are you fixing a BC Break?
How do you reproduce it?
This is an example of a non-strict usage fixed to a strict one: https://github.com/magento/magento2/pull/33353/files. To reproduce it, use the escapeUrl with a null or an int for example (which doesn't make sense when you have full awareness of the system, but may happen in huge applications)
What was the previous behavior?
the input value of most Escaper class methods would be cast to string at some point of the execution of the logic
What is the current behavior?
an error is thrown when non-string value is provided
Signed-off-by: Bartosz Gorski bartosz.m.gorski@gmail.com
Description
The introduction of
declare(strict_types=1);
made the change backwards incompatible with systems using laminas/laminas-escaper as a dependency in a non-strict way. For example Magento: https://github.com/magento/magento2/issues/33346 Don't get me wrong - it's an absolutely great idea to use strict types everywhere. But because of backwards incompatibility reasons, it shouldn't be enforced in a patch version increase (2.7.0 -> 2.7.1).