24 $this->headerLines = [];
25 $this->headerLists = [];
26 $this->headerNames = [];
27 foreach ( $headers as $name => $value ) {
28 $this->headerNames[ strtolower( $name ) ] = $name;
29 list( $valueParts, $valueLine ) = $this->convertToListAndString( $value );
30 $this->headerLines[$name] = $valueLine;
31 $this->headerLists[$name] = $valueParts;
72 list( $valueParts, $valueLine ) = $this->convertToListAndString( $value );
73 $lowerName = strtolower( $name );
74 $origName = $this->headerNames[$lowerName] ??
null;
75 if ( $origName !==
null ) {
76 unset( $this->headerLines[$origName] );
77 unset( $this->headerLists[$origName] );
79 $this->headerNames[$lowerName] = $name;
80 $this->headerLines[$name] = $valueLine;
81 $this->headerLists[$name] = $valueParts;
91 list( $valueParts, $valueLine ) = $this->convertToListAndString( $value );
92 $lowerName = strtolower( $name );
93 $origName = $this->headerNames[$lowerName] ??
null;
94 if ( $origName ===
null ) {
96 $this->headerNames[$lowerName] = $origName;
97 $this->headerLines[$origName] = $valueLine;
98 $this->headerLists[$origName] = $valueParts;
100 $this->headerLines[$origName] .=
', ' . $valueLine;
101 $this->headerLists[$origName] = array_merge( $this->headerLists[$origName],
112 $lowerName = strtolower( $name );
113 $origName = $this->headerNames[$lowerName] ??
null;
114 if ( $origName !==
null ) {
115 unset( $this->headerNames[$lowerName] );
116 unset( $this->headerLines[$origName] );
117 unset( $this->headerLists[$origName] );