This is not an issue, but your code could be enhanced based on the works i did.
The following code will scan ::t functions and for the first 2 arguments replace concats and constants by their correct value. All the scanning is done with Regex expressions.
This is not an issue, but your code could be enhanced based on the works i did. The following code will scan ::t functions and for the first 2 arguments replace concats and constants by their correct value. All the scanning is done with Regex expressions.
It will correctly resolve: Yii::t('appMenu', self::LBL_A); Yii::t('appMenu', self::LBL_A, otherArg); Yii::t('appMenu', OtherClass::LBL_A); Yii::t('appMenu', OtherClassUsedAs::LBL_A); Yii::t('appMenu', selfImplementingClass::LBL_A); Yii::t('appMenu', self::LBL_A . 'xxxx' ); Yii::t( self::LBL_A . 'appMenu', OtherClass::LBL_B . 'xxxx' . OtherClassUsedAs::LBL_C);
The following items are taken into account to resolve constants:
It works quite well and fast on a large project.