dereuromark / cakephp-tools

A CakePHP Tools plugin containing lots of useful helpers, behaviors, components, shells, ...
http://www.dereuromark.de
MIT License
336 stars 142 forks source link

CakePHP 4.5 deprecations #287

Closed LordSimal closed 11 months ago

LordSimal commented 1 year ago

The engine option for TextHelper will be removed in 5.0 in src/View/Helper/TextHelper.php, line: 45

dereuromark commented 1 year ago

Jep, it directly uses

    public function __call(string $method, array $params): mixed {
        return \Tools\Utility\Text::{$method}(...$params);
    }

I wonder if we should shim the engine for Tools "Text" and "Number" here, to allow also easier customization here if needed.

The same is currently done for Time helper where engine is still active.

dereuromark commented 1 year ago

We probably want to backport https://github.com/dereuromark/cakephp-tools/commit/2500c941596e4cf48337c9e0467d7db8d9e17011 into the constructors, overriding core here, allowing the deprecation not to be triggered.

Or can we silence this then incorrect deprecation somehow? I tried

    $e = error_reporting();
    error_reporting($e & ~E_DEPRECATED);

    parent::__construct($View, $config);

    error_reporting($e);

but doesnt work See https://github.com/dereuromark/cakephp-tools/compare/4.5-depr

dereuromark commented 11 months ago

https://github.com/dereuromark/cakephp-tools/releases/tag/2.6.0