This repository was archived by the owner on Sep 17, 2019. It is now read-only.
This repository was archived by the owner on Sep 17, 2019. It is now read-only.
add generics #1
Open
Description
Having generics could be really cool.
A proposed syntax taken from a RFC to php.
class Entry<KeyType, ValueType>
{
protected $key;
protected $value;
public function __construct(KeyType $key, ValueType $value)
{
$this->key = $key;
$this->value = $value;
}
public function getKey(): KeyType
{
return $this->key;
}
public function getValue(): ValueType
{
return $this->value;
}
}