public function getHeaders(): array {
        $result = [];

        foreach ($this->headers as $key => $lines) {
            $name = $this->headerNames[$key];
            $result[$name] = $lines;
        }

        return $result;
    }
public function getHeaders(): array {
        $result = [];

        foreach ($this->headers as $key => $lines) {
            $name = $this->headerNames[$key];
            $result[$name] = $lines;
        }

        return $result;
    }
public function getHeaders ( ) : array { $ result = [ ] ; foreach ( $ this -> headers as $ key => $ lines ) { $ name = $ this -> headerNames [ $ key ] ; $ result [ $ name ] = $ lines ; } return $ result ; }
Retrieves all message headers.

The keys represent the header name as it will be sent over the wire, and
each value is an array of strings associated with the header.

While header names are not case-sensitive, getHeaders() will preserve the
exact case in which headers were originally specified.

@return array Returns an associative array of the message's headers.
Each key is a header name, and each value is an an array of strings.
Retrieves all message headers .