mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-06 14:19:23 +08:00
fixed phpdoc controller to not crash on non-instantiable classes
this happens with codeception classes that are auto generated, they shoud not be changed by phpdoc controller anyway.
This commit is contained in:
@ -479,9 +479,15 @@ class PhpDocController extends Controller
|
||||
|
||||
protected function updateClassPropertyDocs($file, $className, $propertyDoc)
|
||||
{
|
||||
$ref = new \ReflectionClass($className);
|
||||
try {
|
||||
$ref = new \ReflectionClass($className);
|
||||
} catch (\Exception $e) {
|
||||
$this->stderr("[ERR] Unable to create ReflectionClass for class '$className': " . $e->getMessage() . "\n", Console::FG_RED);
|
||||
return false;
|
||||
}
|
||||
if ($ref->getFileName() != $file) {
|
||||
$this->stderr("[ERR] Unable to create ReflectionClass for class: $className loaded class is not from file: $file\n", Console::FG_RED);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$ref->isSubclassOf('yii\base\Object') && $className != 'yii\base\Object') {
|
||||
|
Reference in New Issue
Block a user