PHP 8.2 deprecated creation of dynamic property
In src/JsonMapperHelper.php in JiraCloud\JsonMapperHelper::setUndefinedProperty at line 25
https://github.com/lesstif/php-JiraCloud-RESTAPI/blob/main/src/JsonMapperHelper.php#L25
which is called indirectly by e.g. ComponentService->create($component)
The main source is this: https://github.com/lesstif/php-JiraCloud-RESTAPI/blob/main/src/JiraClient.php#L77
Hi @LordSimal Thank you for reaching out to me. I need to double-check and investigate that If I drop the above codes there is no side effect because this library extremely depends on the Json mapper library.
Thank you!
No problem. I know generated code can be quite tricky to work with. There is a similar issue in another OpenAPI generated library as you can see here: https://github.com/janephp/janephp/issues/726
Deprecated: Creation of dynamic property JiraCloud\Configuration\ArrayConfiguration::$useTokenBasedAuth is deprecated in \vendor\lesstif\jira-cloud-restapi\src\Configuration\ArrayConfiguration.php on line 27 @LordSimal I also found this issue inside the specified file. Is there an easy fix?
You can only fork this repo, adjust the code accordingly and use your fork instead in your project till janephp has fixed the core problem.
Hi @LordSimal, @antoniosammy. I'm so sorry, I totally forgot this ticket in my memory.
Unfortunately, I don't write the PHP code, so it's really difficult to fix this problem. Could you give me any idea or sample code to resolve this deprecated warning, please?
Is related to
- https://github.com/lesstif/php-jira-rest-client/issues/523
Could we release path-version with d0b00d3ce381febc54159d52db611296f3a06ac2 fix?
Hi @solodkiy. I released it as 1.6.3. Thanks!
Looking at the last commit in https://github.com/Korbeil/jane-v8/ it seems nothing is happening related to Jane V8. What is the plan for this plugin to support upcoming PHP-Releases?
@LordSimal Why did you close it? The problem is still not resolved as far as i see?
@lesstif There are still more such deprecated messages i can't supress.
This code for example throw a deprecation in my rest response and i had to downgrade to PHP 8.1. Ummmm, I'm using Version 1.7.0.
<?php
require 'vendor/autoload.php';
use JiraCloud\Attachment\AttachmentService;
use JiraCloud\JiraException;
try {
$attachmentId = 12345;
$outDir = 'attachment_dir';
$atts = new AttachmentService();
$att = $atts->get($attachmentId, $outDir, $overwrite = true);
var_dump($att);
} catch (JiraCloud\JiraException $e) {
print('Error Occurred! ' . $e->getMessage());
}
I closed it because nothing happend in over 1 year and I moved to my own custom implementation of the JIRA API since I don't need all endpoints.
@LordSimal Understand. Indeed it looks very unfinished. But we use it in a app that is used in production :) If your own implementation is open source, please let me know.
My solution is not, because its very limited to our very special usecases and therefore it doesn't provide all the functionality jira provides. But the HTTP API is not that complicated, so you should be pretty easily be able to recreate the same behavior for yourself 😉