Closed alanseiden closed 11 months ago
More info about the deprecation: https://stitcher.io/blog/deprecated-dynamic-properties-in-php-82
I asked what kind of code triggers the deprecation notice.
Anything that creates an instance of ToolkitServiceParameter is going to generate a warning. We've got the code wrapped, so this isn't exactly it, but it will be something like this:
include_once 'iToolkitService.php';
$toolkit = \ToolkitService::getInstance('', '', '');
$params = [];
$params []= $this->toolkit->AddParameterPackDec('both',10,0,'P1','P1',0);
$result = $this->toolkit->PgmCall('PGM1','MYLIB',$params, null, null);
A developer writes: We ran into trouble with an RPG program call in PHP 8.2.
Exception: PHP ERROR Exception: [Creation of dynamic property ToolkitApi\\PackedDecParam::$returnParameter is deprecated][8192]; File: [\/QOpenSys\/chroots\/php8_2\/QOpenSys\/pkgs\/lib\/php\/ToolkitApi\/ToolkitServiceParameter.php]; Line Number: [66]
The constructor is setting a returnParameter that isn't declared. I added this below line below 23
protected $returnParameter;
(This is only a deprecation, but their framework elevated it into an exception. We should correct the issue now.)