You are here

trait HeadersTrait in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/jcalderonzumba/mink-phantomjs-driver/src/HeadersTrait.php \Zumba\Mink\Driver\HeadersTrait

Class HeadersTrait @package Zumba\Mink\Driver

Hierarchy

File

vendor/jcalderonzumba/mink-phantomjs-driver/src/HeadersTrait.php, line 9

Namespace

Zumba\Mink\Driver
View source
trait HeadersTrait {

  /**
   * Gets the current request response headers
   * Should be called only after a request, other calls are undefined behaviour
   * @return array
   */
  public function getResponseHeaders() {
    return $this->browser
      ->responseHeaders();
  }

  /**
   * Current request status code response
   * @return int
   */
  public function getStatusCode() {
    return $this->browser
      ->getStatusCode();
  }

  /**
   * The name say its all
   * @param string $name
   * @param string $value
   */
  public function setRequestHeader($name, $value) {
    $header = array();
    $header[$name] = $value;

    //TODO: as a limitation of the driver it self, we will send permanent for the moment
    $this->browser
      ->addHeader($header, true);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HeadersTrait::getResponseHeaders public function Gets the current request response headers Should be called only after a request, other calls are undefined behaviour
HeadersTrait::getStatusCode public function Current request status code response
HeadersTrait::setRequestHeader public function The name say its all