我很难从PHP源代码创建一个UML类图.
我有以下代码:
abstract class DataSource
{
public function toReferences():array
{
$fields = [];
$keys = $this->getPropertyNames();
foreach( $keys as $key ){
$fields[] = &$this->$key;
}
return $fields;
}
public function getPropertyNames():array
{
return array_keys( get_object_vars( $this ) );
}
}
The function toReferences returns an array (collection) of property references.
Every property can be of a different datatype.
I'm not sure if I could use the well-known pseudotype "mixed" from the php documentation.
If so would this be a correct UML notation?
+toReferences:&mixed[]