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