diff --git a/build/controllers/PhpDocController.php b/build/controllers/PhpDocController.php index eb5b7ea4b0..5e9628250c 100644 --- a/build/controllers/PhpDocController.php +++ b/build/controllers/PhpDocController.php @@ -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') {