src/Message/PartFilter.php
public function setHeaders(array $headers)
    {
        array_walk($headers, function ($v, $k) {
            $this->validateArgument(
                'headers',
                $k,
                [ static::FILTER_EXCLUDE, static::FILTER_INCLUDE ]
            );
            if (!is_array($v)) {
                throw new InvalidArgumentException(
                    '$value must be an array with keys set to FILTER_EXCLUDE, '
                    . 'FILTER_INCLUDE and values set to an array of header '
                    . 'name => values'
                );
            }
        });
        $this->headers = $headers;
    }
public function setHeaders(array $headers)
    {
        array_walk($headers, function ($v, $k) {
            $this->validateArgument(
                'headers',
                $k,
                [ static::FILTER_EXCLUDE, static::FILTER_INCLUDE ]
            );
            if (!is_array($v)) {
                throw new InvalidArgumentException(
                    '$value must be an array with keys set to FILTER_EXCLUDE, '
                    . 'FILTER_INCLUDE and values set to an array of header '
                    . 'name => values'
                );
            }
        });
        $this->headers = $headers;
    }
public function setHeaders ( array $ headers ) { array_walk ( $ headers , function ( $ v , $ k ) { $ this -> validateArgument ( 'headers' , $ k , [ static :: FILTER_EXCLUDE , static :: FILTER_INCLUDE ] ) ; if ( ! is_array ( $ v ) ) { throw new InvalidArgumentException ( '$value must be an array with keys set to FILTER_EXCLUDE, ' . 'FILTER_INCLUDE and values set to an array of header ' . 'name => values' ) ; } } ) ; $ this -> headers = $ headers ; }
Sets the PartFilter's headers filter to the passed array after validating
it.

@param array $headers
@throws InvalidArgumentException
Sets the PartFilter s headers filter to the passed array after validating it .