dereuromark/cakephp-queue

Deprecation message with CakePHP 4.5.0

Closed this issue · 10 comments

the command bin/cake queue worker end server triggers a deprecation message

CakePHP 4.5.0
Queue-Version: 6.7.2

4.5.0 - Dynamic properties will be removed in PHP 8.2. Add public $QueueProcesses = null; to your class definition.
/my-app/vendor/cakephp/cakephp/src/Command/Command.php, line: 56
You can disable all deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED. Adding vendor/cakephp/cakephp/src/Command/Command.php to Error.ignoredDeprecationPaths in your config/app.php config will mute deprecations from that file only.
Trace:
/my-app/vendor/cakephp/cakephp/src/Core/functions.php /my-app/vendor/cakephp/cakephp/src/Core/functions.php, line 300
/my-app/vendor/cakephp/cakephp/src/Datasource/ModelAwareTrait.php /my-app/vendor/cakephp/cakephp/src/Datasource/ModelAwareTrait.php, line 122
Cake\Command\Command->loadModel() /my-app/vendor/cakephp/cakephp/src/Command/Command.php, line 56
Cake\Command\Command->__construct() /my-app/vendor/cakephp/cakephp/src/Console/CommandFactory.php, line 51
Cake\Console\CommandFactory->create() /my-app/vendor/cakephp/cakephp/src/Console/CommandRunner.php, line 375
Cake\Console\CommandRunner->createCommand() /my-app/vendor/cakephp/cakephp/src/Console/CommandRunner.php, line 248
Cake\Console\CommandRunner->getCommand() /my-app/vendor/cakephp/cakephp/src/Console/CommandRunner.php, line 167
Cake\Console\CommandRunner->run() /my-app/bin/cake.php, line 12

Do u want to make a PR removing all those property usage?
Or just adding the missing property?

The alternative I would prefer right now is to set the attribute for it.

#[AllowDynamicProperties]

This has less changes and thus less possible negative side effects for now.

Do u want to make a PR removing all those property usage? Or just adding the missing property?

This time, I prefer not to be involved in fixing my issue. If that's ok for you.

I started #389
I will see what can be done regarding the loadModel() calls.
Adding the property doesnt work and creates errors. So either we refactor fully or we need to silence the deprecations if attribute is there

Thanks. I updated my app but I still get the same deprecation message.

Well, the main issue wont go away unless we ship cakephp/cakephp#17383 and you use PHP 8.2+

The alternative would be to completely refactor away from properties and use fetchTable() everywhere, similar to what already done in 5.x version I assume.

Well, the main issue wont go away unless we ship cakephp/cakephp#17383 and you use PHP 8.2+

Ok, thank you for the clarification. I'll wait for that.

I am not sure it is gonna happen
You could backport similar changes as 7.0.0-RC...7.0.0 to Cake4 branch.
Then we can release a patch here.

If its fixed when I switch to CakePHP 5, thats fine for me. So I won't backport the changings.