Exemple #1
0
 /**
  * @param HttpCredentials|null $credentials
  *
  * @return $this
  */
 public function setHttpCredentials(HttpCredentials $credentials = null)
 {
     if ($credentials === null) {
         $this->httpCredentials->clear();
     } else {
         $this->httpCredentials->fillWith($credentials);
     }
     return $this;
 }
 /**
  * @return HttpCredentials
  */
 public function getHttpCredentials()
 {
     $credentials = new HttpCredentials();
     if ($this->hasHttpCredentials()) {
         $credentials->set($this->httpUsername, $this->httpPassword);
     }
     return $credentials;
 }
Exemple #3
0
 /**
  * @return string[]|null
  */
 public function getAuthData()
 {
     return $this->httpCredentials && $this->httpCredentials->present() ? [$this->httpCredentials->getUsername(), $this->httpCredentials->getPassword()] : null;
 }