yiisoft / yii

Yii PHP Framework 1.1.x
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
4.84k stars 2.28k forks source link

Deprecated dynamic properties in yii\framework\gii\components\Pear\Text\Diff\Engine\native.php . #4534

Closed mdeweerd closed 1 year ago

mdeweerd commented 1 year ago
Deprecated: Creation of dynamic property Text_Diff_Engine_native::$xchanged is deprecated .../yii\framework\gii\components\Pear\Text\Diff\Engine\native.php on line 41

I ran into this when performing a 'diff' in the yii code generator.

Non of the properties are defined in native.php.

I dropped in the following definitions, more may be needed:

    public $xchanged;
    public $ychanged;
    public $xv;
    public $yv;
    public $xind;
    public $yind;
    public $seq;
    public $in_seq;
    public $lcs;
samdark commented 1 year ago

What Yii version do you have?

mdeweerd commented 1 year ago

Yii v1.1.28

This is related to assignments to class properties that are not declared:

https://github.com/yiisoft/yii/blob/1.1.28/framework/gii/components/Pear/Text/Diff/Engine/native.php#L41-L43 .

mdeweerd commented 1 year ago

Wordpress has an evolved version: https://github.com/WordPress/WordPress/blob/master/wp-includes/Text/Diff/Engine/native.php

mdeweerd commented 1 year ago

I opened a PR in upstream - there were also some changes to replace looping over list() the approach for the latter is different than that in Yii where unshift was applied.

https://github.com/pear/Text_Diff/pull/8

marcovtwout commented 1 year ago

I created a PR and applied changes even though the upstream PR is not yet merged.

marcovtwout commented 1 year ago

Fixed with https://github.com/yiisoft/yii/pull/4536