Oroboros Core
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • None
  • oroboros
    • core
      • abstracts
        • adapters
        • bootstrap
        • controllers
        • libraries
          • auth
          • bootstrap
          • cache
          • codex
          • config
          • container
          • data
          • database
          • dns
          • entity
          • enum
          • error
          • event
          • extension
          • file
          • flags
          • hooks
          • job
          • logger
          • manager
          • message
          • prototype
          • request
          • response
          • routine
          • shell
          • startup
          • stream
          • template
          • uri
          • utility
          • validation
            • workers
          • worker
        • models
        • patterns
          • behavioral
          • creational
        • utilities
          • exception
            • cache
            • container
          • http
        • views
      • interfaces
        • adapters
          • interpreters
          • sdk
        • api
          • adapters
          • bootstrap
          • controllers
          • psr
        • contract
          • adapters
          • bootstrap
          • codex
          • components
          • controllers
          • data
          • entities
          • errors
          • events
          • extensions
          • jobs
          • libraries
            • auth
            • cache
            • config
            • container
            • enum
            • file
            • flags
            • hooks
            • module
            • promise
            • record
            • request
            • response
            • server
            • shutdown
            • site
            • stream
            • template
            • theme
            • uri
          • models
          • patterns
            • behavioral
            • concurrency
            • creational
            • structural
          • routes
          • routines
            • bootload
            • declarative
            • procedural
            • subsystem
          • services
            • consumer
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
            • provider
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
          • utilities
            • datetime
            • exception
              • cache
              • container
            • filebase
            • http
            • math
            • parser
            • regex
            • session
          • views
        • enumerated
          • environment
          • flags
          • http
          • views
        • libraries
          • manager
          • worker
      • libraries
        • api
        • codex
        • container
        • enum
          • http
        • file
        • hooks
        • logger
        • math
        • psr4
        • request
        • response
        • stream
        • uri
      • patterns
        • creational
      • traits
        • adapters
        • bootstrap
        • codex
        • components
        • controllers
        • data
        • entities
        • events
        • extensions
        • jobs
        • libraries
          • container
          • file
          • request
          • response
          • stream
          • uri
        • models
        • modules
        • patterns
          • behavioral
          • concurrency
          • creational
          • structural
        • routes
        • services
        • utilities
          • core
            • api
            • config
            • contract
              • contract
            • enum
            • environment
            • routines
          • datetime
          • error
          • exception
          • filebase
          • hooks
          • html
          • http
          • logic
          • math
          • parsers
          • regex
          • session
        • views
      • utilities
        • exception
          • cache
          • container
        • http
      • views
    • tests
      • patterns
        • creational
      • psr
        • psr7
      • utilities
        • exception
  • PasswordCompat
    • binary
  • PHP

Interfaces

  • CookieContract
  • HeaderContract
  • ProtocolContract
  • RequestMethodContract
  • StatusCodeContract

Interface HeaderContract


Contract interfaces enforce expected behavior in a non-colliding way. They are tasked with enforcing methods, and extending interfaces provided by standards and other packages for compatibility.

All valid oroboros classes MUST extend at

least one Contract Interface to be considered valid.

oroboros\core\interfaces\contract\utilities\http\HeaderContract implements oroboros\core\interfaces\contract\utilities\UtilityContract

Direct known implementers

oroboros\core\abstracts\utilities\http\AbstractHeader, oroboros\core\abstracts\utilities\http\AbstractRequestHeader, oroboros\core\abstracts\utilities\http\AbstractResponseHeader

Indirect known implementers

oroboros\core\utilities\http\Header, oroboros\core\utilities\http\RequestHeader, oroboros\core\utilities\http\ResponseHeader

Namespace: oroboros\core\interfaces\contract\utilities\http
Package: oroboros\core\utilities
Category: contract-interfaces
License: The MIT License (MIT)
Author: Brian Dayhoff mopsyd@me.com
Version: 0.2.4-alpha
Since: 0.2.4-alpha
Link: bitbucket.org/oroborosframework/oroboros-core/wiki/development/api/contract_interface.md
Located at core/interfaces/contract/utilities/http/HeaderContract.php

Methods summary

public
# __construct( string $name, string|array $value, string $type = 'response', string $separator = ',' )

Constructs an object representation of a header

Constructs an object representation of a header

Parameters

$name
the case insensitive header name
$value
$values Represents the value of the header. May be a string or an array. If the header can have multiple values and a string is passed, the string will be split based on the defined separator.
$type
$separator (optional) designates the correct separator for headers that carry multiple values. Defaults to a comma if not supplied.
$separator
$type (optional) designates whether the specified header is a request or response header. Assumes response if not defined otherwise.

Throws

oroboros\core\utilities\exception\InvalidArgumentException
if an invalid parameter was passed

Link

https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
public string
# __toString( )

Hooks into native PHP string language constructs, and returns the string representation of the header value.

Hooks into native PHP string language constructs, and returns the string representation of the header value.

Returns

string
public string
# getName( )

Returns the name of the header.

Returns the name of the header.

Returns

string
public array
# getValue( )

Returns the value(s) of the header, represented as an array.

Returns the value(s) of the header, represented as an array.

Returns

array
public string
# getValueString( )

Returns only the header value, contencated as a string.

Returns only the header value, contencated as a string.

Returns

string
public
# setValue( string|array $value )

Replaces the existing value with the supplied value.

Replaces the existing value with the supplied value.

Parameters

$value

Throws

oroboros\core\utilities\exception\InvalidArgumentException
if an invalid parameter was passed
public
# appendValue( string $value )

Adds an additional value to append to the header value. This method will not replace existing values.

Adds an additional value to append to the header value. This method will not replace existing values.

Parameters

$value

Throws

oroboros\core\utilities\exception\InvalidArgumentException
if an invalid parameter was passed
public
# send( )

Sends the header. This will replace the same header if it has already been sent.

Sends the header. This will replace the same header if it has already been sent.

Oroboros Core API documentation generated by ApiGen