protected function addOptionalHeader(array &$headers, $key, $value)
    {
        Validate::isArray($headers, 'headers');
        Validate::canCastAsString($key, 'key');
        Validate::canCastAsString($value, 'value');

        if (!is_null($value) && Resources::EMPTY_STRING !== $value) {
            $headers[$key] = $value;
        }
    }
protected function addOptionalHeader(array &$headers, $key, $value)
    {
        Validate::isArray($headers, 'headers');
        Validate::canCastAsString($key, 'key');
        Validate::canCastAsString($value, 'value');

        if (!is_null($value) && Resources::EMPTY_STRING !== $value) {
            $headers[$key] = $value;
        }
    }
protected function addOptionalHeader ( array & $ headers , $ key , $ value ) { Validate :: isArray ( $ headers , 'headers' ) ; Validate :: canCastAsString ( $ key , 'key' ) ; Validate :: canCastAsString ( $ value , 'value' ) ; if ( ! is_null ( $ value ) && Resources :: EMPTY_STRING !== $ value ) { $ headers [ $ key ] = $ value ; } }
Adds optional header.

Doesn't add the value if it satisfies empty().

@param array  &$headers The HTTP header parameters.
@param string $key      The HTTP header name.
@param string $value    The HTTP header value.

@return void
Adds optional header .