jolicode / slack-php-api

:hash: PHP Slack Client based on the official OpenAPI specification
https://jolicode.github.io/slack-php-api/
MIT License
221 stars 54 forks source link

PHP>=8.2 Creation of dynamic property is deprecated #164

Closed divinity76 closed 5 months ago

divinity76 commented 5 months ago

as of PHP8.2

Deprecated: Creation of dynamic property JoliCode\Slack\Api\Endpoint\ChatPostMessage::$formParameters is deprecated in /var/www/vendor/jolicode/slack-php-api/generated/Endpoint/ChatPostMessage.php on line 50

a quickfix would be to add

    /** @var array */
    public $formParameters = [];

to generated/Runtime/Client/EndpointTrait.php , but how to make the GENERATOR add that, i have no idea.

PR #161 tried to fix it (but did not address the generator issue)

damienalexandre commented 5 months ago

This should be fixed with the latest release v4.7.0 :tada:

divinity76 commented 5 months ago

@damienalexandre with just reading through the code, i fail to see how that update could have fixed it: JoliCode\Slack\Api\Endpoint\ChatPostMessage::formParameters still reference $this->formParameters which is not declared in any of generated/Endpoint/ChatPostMessage.php and generated/Runtime/Client/EndpointTrait.php and generated/Runtime/Client/Endpoint.php , am i missing something?

damienalexandre commented 5 months ago

It can be seen here: https://github.com/jolicode/slack-php-api/blob/86f0b47862d045a6cffa8974d60e67350daa79df/generated/Runtime/Client/BaseEndpoint.php#L23

divinity76 commented 5 months ago

somehow missed it, thanks!