Skip to content

Commit

Permalink
Fixes "PossiblyNullArgument" Psalm warnings.
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Citharel <tcit@tcit.fr>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
  • Loading branch information
2 people authored and szaimen committed Jun 12, 2023
1 parent 0bae21b commit 8c64cca
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Publishing/PublishPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function httpPost(RequestInterface $request, ResponseInterface $response)
$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;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/MultiGetExportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function httpReport(RequestInterface $request, ResponseInterface $respons
}

// 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;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/PhotoCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private function getBinaryType(Binary $photo) {
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;
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/DAV/Sharing/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function httpPost(RequestInterface $request, ResponseInterface $response)
$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;
}
Expand Down

0 comments on commit 8c64cca

Please sign in to comment.