proget-hq / phpstan-yii2

Yii2 extension for PHPStan
MIT License
52 stars 18 forks source link

Use of undefined constant YII_DEBUG #34

Closed MashaGorbunova closed 3 years ago

MashaGorbunova commented 4 years ago

When I run analyze my Yii2 project with phpstan v 0.12.34 and proget-hq/phpstan-yii2 v 0.7.3 I get next warning:

PHP Warning:  Use of undefined constant YII_DEBUG - assumed 'YII_DEBUG' (this will throw an Error in a future version of PHP) in /config/web.php on line 54
Warning: Use of undefined constant YII_DEBUG - assumed 'YII_DEBUG' (this will throw an Error in a future version of PHP) in /config/web.php on line 54

It appears, because in class ServiceMap there aren't defined this constant. If add to this class constant \defined('YII_DEBUG') or define('YII_DEBUG', true); it is all right. Please, fix this bug in your future release.