Esempio n. 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;
 }
Esempio n. 2
0
 /**
  * @return HttpCredentials
  */
 public function getHttpCredentials()
 {
     $credentials = new HttpCredentials();
     if ($this->hasHttpCredentials()) {
         $credentials->set($this->httpUsername, $this->httpPassword);
     }
     return $credentials;
 }
Esempio n. 3
0
 /**
  * @return string[]|null
  */
 public function getAuthData()
 {
     return $this->httpCredentials && $this->httpCredentials->present() ? [$this->httpCredentials->getUsername(), $this->httpCredentials->getPassword()] : null;
 }