Skip to content

Commit f145eae

Browse files
committed
[request] improvement: use null coalescing operator
1 parent a505277 commit f145eae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/request/sfWebRequest.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ public function getPathInfoArray()
663663
*/
664664
public function getMimeType($format)
665665
{
666-
return isset($this->formats[$format]) ? $this->formats[$format][0] : null;
666+
return $this->formats[$format][0] ?? null;
667667
}
668668

669669
/**
@@ -862,7 +862,7 @@ public function getClientIp($proxy = true)
862862
}
863863

864864
if ($this->getOption('trust_proxy') && ($ip = $this->getForwardedFor())) {
865-
return isset($ip[0]) ? trim($ip[0]) : '';
865+
return trim($ip[0] ?? '');
866866
}
867867
}
868868

0 commit comments

Comments
 (0)