Fixes "PossiblyNullArgument" Psalm warnings.

Co-authored-by: Thomas Citharel <tcit@tcit.fr>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
pull/38610/head
Faraz Samapoor 2023-06-02 19:38:38 +07:00 committed by Simon L
parent 0bae21b1d1
commit 8c64ccae01
4 changed files with 4 additions and 4 deletions

@ -155,7 +155,7 @@ class PublishPlugin extends ServerPlugin {
$path = $request->getPath();
// Only handling xml
$contentType = $request->getHeader('Content-Type');
$contentType = (string) $request->getHeader('Content-Type');
if (!str_contains($contentType, 'application/xml') && !str_contains($contentType, 'text/xml')) {
return;
}

@ -61,7 +61,7 @@ class MultiGetExportPlugin extends DAV\ServerPlugin {
}
// Only handling xml
$contentType = $response->getHeader('Content-Type');
$contentType = (string) $response->getHeader('Content-Type');
if (!str_contains($contentType, 'application/xml') && !str_contains($contentType, 'text/xml')) {
return;
}

@ -264,7 +264,7 @@ class PhotoCache {
if (isset($params['TYPE']) || isset($params['MEDIATYPE'])) {
/** @var Parameter $typeParam */
$typeParam = isset($params['TYPE']) ? $params['TYPE'] : $params['MEDIATYPE'];
$type = $typeParam->getValue();
$type = (string) $typeParam->getValue();
if (str_starts_with($type, 'image/')) {
return $type;

@ -125,7 +125,7 @@ class Plugin extends ServerPlugin {
$path = $request->getPath();
// Only handling xml
$contentType = $request->getHeader('Content-Type');
$contentType = (string) $request->getHeader('Content-Type');
if (!str_contains($contentType, 'application/xml') && !str_contains($contentType, 'text/xml')) {
return;
}