lesstif / php-jira-rest-client

PHP classes interact Jira with the REST API.
Other
510 stars 263 forks source link

Issue with dynamic property creation (php8.2) #530

Open jeremy379 opened 7 months ago

jeremy379 commented 7 months ago

Hello

I encountered an issue in php8.2 due to dynamic property creation when retrieving a comment and the params "jsdPublic" is sent back by Jira.

The error happens in src/JsonMapperHelper.php:25 when loading a src/Issue/Comment.php

ErrorException: Creation of dynamic property JiraRestApi\Issue\Comment::$jsdPublic is deprecated in /vendor/lesstif/php-jira-rest-client/src/JsonMapperHelper.php:25
Stack trace:
    #0 /vendor/lesstif/php-jira-rest-client/src/JsonMapperHelper.php(25): {closure}()
    #1 /vendor/netresearch/jsonmapper/src/JsonMapper.php(187): JiraRestApi\JsonMapperHelper::setUndefinedProperty()
    #2 /vendor/netresearch/jsonmapper/src/JsonMapper.php(471): JsonMapper->map()
    #3 /vendor/netresearch/jsonmapper/src/JsonMapper.php(305): JsonMapper->mapArray()
    #4 /vendor/netresearch/jsonmapper/src/JsonMapper.php(318): JsonMapper->map()
    #5 /vendor/netresearch/jsonmapper/src/JsonMapper.php(318): JsonMapper->map()
    #6 /vendor/lesstif/php-jira-rest-client/src/Issue/IssueService.php(50): JsonMapper->map()
    #7 MyImplem: JiraRestApi\Issue\IssueService->get()

It seems it try to set any property it find in the json, and there is a lot more than what's existing. (It even try to set some stuff to the \Datetime object).

jeremy379 commented 7 months ago

MR opened for this issue: https://github.com/lesstif/php-jira-rest-client/pull/531