Closed manuel-rabade closed 5 months ago
Can you share a stack strace? Thanks
Sure @lyrixx , here it is:
2023-04-20 00:06:59 notice: Creation of dynamic property JoliCode\Slack\Api\Endpoint\ChatPostMessage::$formParameters is deprecated
Trace:
JoliCode\Slack\Api\Endpoint\ChatPostMessage::__construct() /home/vagrant/code/sistema/cake/vendor/jolicode/slack-php-api/generated/Endpoint/ChatPostMessage.php, line 49
JoliCode\Slack\Api\Client::chatPostMessage() /home/vagrant/code/sistema/cake/vendor/jolicode/slack-php-api/generated/Client.php, line 1806
App\Utility\SlackLib::post() /home/vagrant/code/sistema/cake/src/Utility/SlackLib.php, line 77
App\Utility\SlackLib::enviarMensaje() /home/vagrant/code/sistema/cake/src/Utility/SlackLib.php, line 44
App\Command\MonitorClasicosCommand::execute() /home/vagrant/code/sistema/cake/src/Command/MonitorClasicosCommand.php, line 29
Cake\Console\BaseCommand::run() /home/vagrant/code/sistema/cake/vendor/cakephp/cakephp/src/Console/BaseCommand.php, line 189
Cake\Console\CommandRunner::runCommand() /home/vagrant/code/sistema/cake/vendor/cakephp/cakephp/src/Console/CommandRunner.php, line 334
Cake\Console\CommandRunner::run() /home/vagrant/code/sistema/cake/vendor/cakephp/cakephp/src/Console/CommandRunner.php, line 172
[main] /home/vagrant/code/sistema/cake/bin/cake.php, line 12
I'm getting the same thing. Would just like to add that a quick fix could be to add the #[\AllowDynamicProperties]
attribute. I don't know anything about JanePHP to know whether that's a workable solution, though.
My stack trace is the same though, so interesting that it only happens for that field in particular.
ErrorException: Deprecated: Creation of dynamic property JoliCode\Slack\Api\Endpoint\ChatPostMessage::$formParameters is deprecated
#2 /var/www/html/vendor/jolicode/slack-php-api/generated/Endpoint/ChatPostMessage.php(49): JoliCode\Slack\Api\Endpoint\ChatPostMessage::__construct
#1 /var/www/html/vendor/jolicode/slack-php-api/generated/Client.php(1806): JoliCode\Slack\Api\Client::chatPostMessage
#0 /var/www/html/cron/cron.php(47): null
Thanks for this api! Any update on this? It's affecting us as well.
If you are okay with adding #[\AllowDynamicProperties]
, I can totally open a PR here.
I'm getting the same error for ChatUpdate. Declaring the properties or adding #[\AllowDynamicProperties]
should solve this
Seems to be a PHP 8.2 issue https://php.watch/versions/8.2/dynamic-properties-deprecated