public function put(string $key, $value): self
    {
        if (!is_scalar($value)) {
            throw new \InvalidArgumentException(
                    'Argument 2 passed to ' . __METHOD__
                    . ' must be an instance of a scalar value.'
            );
        }

        $this->headers[$key] = (string) $value;
        return $this;
    }
public function put(string $key, $value): self
    {
        if (!is_scalar($value)) {
            throw new \InvalidArgumentException(
                    'Argument 2 passed to ' . __METHOD__
                    . ' must be an instance of a scalar value.'
            );
        }

        $this->headers[$key] = (string) $value;
        return $this;
    }
public function put ( string $ key , $ value ) : self { if ( ! is_scalar ( $ value ) ) { throw new \ InvalidArgumentException ( 'Argument 2 passed to ' . __METHOD__ . ' must be an instance of a scalar value.' ) ; } $ this -> headers [ $ key ] = ( string ) $ value ; return $ this ; }
creates header with value for key

@param   string  $key    name of header
@param   scalar  $value  value of header
@return  \stubbles\peer\HeaderList
@throws  \InvalidArgumentException
creates header with value for key