/** * @param $name * @param $email * @param RecipientType|null $type */ public function __construct($name, $email, RecipientType $type = null) { $this->name = $name; $this->email = $email; $this->type = null !== $type ? $type : RecipientType::to(); }
/** * @param RecipientType $type * @return bool */ public function equals(RecipientType $type) { return $this->getType() === $type->getType(); }