Garethp / php-ews

PHP Exchange Web Services
BSD 3-Clause "New" or "Revised" License
112 stars 45 forks source link

PHP 8.2 - Deprecated dynamic properties #248

Open Carlmundo opened 1 year ago

Carlmundo commented 1 year ago

https://php.watch/versions/8.2/dynamic-properties-deprecated

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Subject is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$BodyType is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Body is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$EmailAddress is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$ToRecipients is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$EmailAddress is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Mailbox is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$From is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Message is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Items is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$MessageDisposition is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Subject is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$BodyType is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Body is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$EmailAddress is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$ToRecipients is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$EmailAddress is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Mailbox is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$From is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Message is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$Items is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

Deprecated: Creation of dynamic property garethp\ews\API\Type::$MessageDisposition is deprecated in /home/site/vendor/garethp/php-ews/src/API/MagicMethodsTrait.php on line 44

kl3sk commented 9 months ago

@Garethp Is this library maintained ? And be compatible with PHP 8.2+ ?

Thanks

Garethp commented 9 months ago

Hey.

It's been almost a decade since I've needed this library myself and I haven't worked with PHP in quite a long time. If someone reports an actual bug with enough information that I can easily reproduction I'm happy to fix it, but I don't think I've had any real bugs reported in years, it's mostly been people who haven't been sure how to use the EWS API.

That being said, migrating this project to not use Dynamic Properties is a very large piece of work and would be a breaking change none the less. All of the code that would need to be changed is automatically generated from the xsd files that are distributed by EWS. To move away from dynamic properties I'd have to work on having it generate a fair bit more code to wrap everything in getter/setter functions with multiple different auto generated functions per type of property.

Unfortunately it's unlikely that I'm going to be making that massive shift, so I'm happy to keep things working for PHP 8 but I probably wouldn't migrate this library to continue working for PHP 9 unless I found myself in another PHP job where I needed to use the EWS Library again, or unless a company that needed it's continued support paid for the time needed to upgrade it.

With that said, if someone forks it and makes the required changes, I'd be happy to give what advice I can and accept their changes back into this project, releasing a new major version to indicate the breaking change.

kl3sk commented 9 months ago

Thanks you for your quick answer.

I totally understand your position, even if it is a bad news for this library.

I have to find a suitable solution for me.

Regards

Carlmundo commented 8 months ago

Thanks for all your work @Garethp.

@kl3sk - Did you find another solution?

kl3sk commented 8 months ago

Hi @Carlmundo,

I indeed, find an other solution in conjonction with my company technical team. I now use the (Deprecated) REST Api.

Garethp commented 2 months ago

I've previously said that I wouldn't be making a PHP 9.0 upgrade due to the difficulty of regenerating the classes that underly the system. One of the issues was that the packages I was using to generate the code was experimental and no longer supported. In fact, it was even more broken in PHP8 then before.

That being said, php-ews is easily one of the projects I'm most proud of and I'm not keen on seeing it die if I can help it.

I've started investigating a PHP 9 update and I've managed to fix the code generator so that at the very least it's generating code that matches the existing classes. While that doesn't mean much in itself, it is the first hurdle towards a PHP 9 upgrade.