raoul2000 / yii2-workflow

A simple workflow engine for Yii2
BSD 3-Clause "New" or "Revised" License
171 stars 48 forks source link

Added PHP 7.2 compatibility and removed unused namespaces #49

Closed pappfer closed 6 years ago

pappfer commented 6 years ago

PHP 7.2 has been released a couple of days ago and we need to make some changes in order this extension to be compatible with that. Needed to change yii\base\Object to yii\base\BaseObject.

I also removed unused namespaces.

raoul2000 commented 6 years ago

thanks

raoul2000 commented 6 years ago

just one question : why rename \yii\base\Object to \yii\base\BaseObject ? The UPGRADE instruction for yii 2.10.13 states that :

yii\base\Object still exists for backwards compatibility and will be loaded if needed in projects that are running on PHP <7.2. The compatibility class yii\base\Object extends from yii\base\BaseObject so if you have classes that extend from yii\base\Object these would still work.

Renaming to BaseObject would then break backward compatibility isn't it ?

pappfer commented 6 years ago

@raoul2000 renaming to \yii\base\BaseObject will make it work with PHP 7.2 and older versions as well. If we leave it as \yii\base\Object it won't work with PHP 7.2, it will only work with older versions of PHP. Yii2 devs didn't remove \yii\base\Object, because if they did, some extensions may have stopped working, so they left it there because of backwards compatibility, but all extensions using that (including your one) will fail on PHP 7.2 and above.

By the way I can see that the tests were not successfull, it is because some Composer packages requires PHP 7.0 or above. I didn't have the time to fix it, I'll check it later.

raoul2000 commented 6 years ago

@pappfer agreed ... but, someone using Yii version before 2.0.13 will not be able to upgrade to the latest version of yii2-workflow if this one is refering to \yii\base\BaseObject right ? ... so maybe it is better to create a branch.

pappfer commented 6 years ago

@raoul2000 Yeah, it might be a good idea to create a branch.

cornernote commented 6 years ago

This has been changed quite some time ago. Are we able to merge this?

The ideal way to release is using a new version of 1.2.0. If someone wants the old Object then they use the current version 1.1.0.

raoul2000 commented 6 years ago

I'm late, sorry. I'll work on this one this week-end