@@ -292,7 +292,7 @@ public function __unset($id) {
292
292
* @param string $name
293
293
* @return string|null
294
294
*/
295
- public function getHeader ($ name ) {
295
+ public function getHeader (string $ name ): ? string {
296
296
$ name = \strtoupper (\str_replace (['- ' ], ['_ ' ], $ name ));
297
297
if (isset ($ this ->server ['HTTP_ ' . $ name ])) {
298
298
return $ this ->server ['HTTP_ ' . $ name ];
@@ -391,8 +391,8 @@ protected function getContent() {
391
391
if ($ this ->method === 'PUT '
392
392
&& $ this ->getHeader ('Content-Length ' ) !== 0
393
393
&& $ this ->getHeader ('Content-Length ' ) !== null
394
- && \strpos ($ this ->getHeader ('Content-Type ' ), 'application/x-www-form-urlencoded ' ) === false
395
- && \strpos ($ this ->getHeader ('Content-Type ' ), 'application/json ' ) === false
394
+ && \strpos ($ this ->getHeader ('Content-Type ' ) ?? '' , 'application/x-www-form-urlencoded ' ) === false
395
+ && \strpos ($ this ->getHeader ('Content-Type ' ) ?? '' , 'application/json ' ) === false
396
396
) {
397
397
if ($ this ->content === false ) {
398
398
throw new \LogicException (
@@ -431,7 +431,7 @@ protected function decodeContent() {
431
431
// or post correctly
432
432
} elseif ($ this ->method !== 'GET '
433
433
&& $ this ->method !== 'POST '
434
- && \strpos ($ this ->getHeader ('Content-Type ' ), 'application/x-www-form-urlencoded ' ) !== false ) {
434
+ && \strpos ($ this ->getHeader ('Content-Type ' ) ?? '' , 'application/x-www-form-urlencoded ' ) !== false ) {
435
435
\parse_str (\file_get_contents ($ this ->inputStream ), $ params );
436
436
if (\is_array ($ params )) {
437
437
$ this ->items ['params ' ] = $ params ;
0 commit comments