27 $this->headerLines = [];
28 $this->headerLists = [];
29 $this->headerNames = [];
30 foreach ( $headers as $name => $value ) {
31 $this->headerNames[ strtolower( $name ) ] = $name;
32 [ $valueParts, $valueLine ] = $this->convertToListAndString( $value );
33 $this->headerLines[$name] = $valueLine;
34 $this->headerLists[$name] = $valueParts;
75 [ $valueParts, $valueLine ] = $this->convertToListAndString( $value );
76 $lowerName = strtolower( $name );
77 $origName = $this->headerNames[$lowerName] ??
null;
78 if ( $origName !==
null ) {
79 unset( $this->headerLines[$origName] );
80 unset( $this->headerLists[$origName] );
82 $this->headerNames[$lowerName] = $name;
83 $this->headerLines[$name] = $valueLine;
84 $this->headerLists[$name] = $valueParts;
94 [ $valueParts, $valueLine ] = $this->convertToListAndString( $value );
95 $lowerName = strtolower( $name );
96 $origName = $this->headerNames[$lowerName] ??
null;
97 if ( $origName ===
null ) {
99 $this->headerNames[$lowerName] = $origName;
100 $this->headerLines[$origName] = $valueLine;
101 $this->headerLists[$origName] = $valueParts;
103 $this->headerLines[$origName] .=
', ' . $valueLine;
104 $this->headerLists[$origName] = array_merge( $this->headerLists[$origName],
115 $lowerName = strtolower( $name );
116 $origName = $this->headerNames[$lowerName] ??
null;
117 if ( $origName !==
null ) {
118 unset( $this->headerNames[$lowerName] );
119 unset( $this->headerLines[$origName] );
120 unset( $this->headerLists[$origName] );