Since: 2.0
Author: Paul Klimov (klimov.paul@gmail.com)
Inheritance: extends yii\base\Component
Example #1
0
 /**
  * @inheritdoc
  */
 public function getCookies()
 {
     $cookieCollection = parent::getCookies();
     if ($cookieCollection->getCount() === 0 && $this->getHeaders()->has('set-cookie')) {
         $cookieStrings = $this->getHeaders()->get('set-cookie', [], false);
         foreach ($cookieStrings as $cookieString) {
             $cookieCollection->add($this->parseCookie($cookieString));
         }
     }
     return $cookieCollection;
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function toString()
 {
     if (!$this->isPrepared) {
         $this->prepare();
     }
     $result = strtoupper($this->getMethod()) . ' ' . $this->getFullUrl();
     $parentResult = parent::toString();
     if ($parentResult !== '') {
         $result .= "\n" . $parentResult;
     }
     return $result;
 }
 /**
  * @inheritdoc
  */
 public function toString()
 {
     $result = strtoupper($this->getMethod()) . ' ' . $this->getUrl();
     $parentResult = parent::toString();
     if ($parentResult !== '') {
         $result .= "\n" . $parentResult;
     }
     return $result;
 }