/** * {@inheritdoc} */ public function __toString() { if ($this->user->isEmpty()) { return ''; } if ($this->pass->isEmpty()) { return $this->user->__toString(); } return $this->user->__toString() . ':' . $this->pass->__toString(); }
/** * {@inheritdoc} */ public function toArray() { return ['user' => $this->user->isEmpty() ? null : $this->user->__toString(), 'pass' => $this->pass->isEmpty() ? null : $this->pass->__toString()]; }