constantNaming = $constantNaming; $this->phpDocInfoFactory = $phpDocInfoFactory; } public function createFromProperty(Property $property): ClassConst { $propertyProperty = $property->props[0]; $constantName = $this->constantNaming->createFromProperty($propertyProperty); /** @var Expr $defaultValue */ $defaultValue = $propertyProperty->default; $const = new Const_($constantName, $defaultValue); $classConst = new ClassConst([$const]); $classConst->flags = $property->flags & ~ Class_::MODIFIER_STATIC; $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property); $phpDocInfo->markAsChanged(); $classConst->setAttribute(AttributeKey::PHP_DOC_INFO, $phpDocInfo); return $classConst; } }