mirror of
https://github.com/friendica/friendica
synced 2025-05-03 11:44:09 +02:00
Replace deprecated calls to defaults() by ?? and ?: in src/
This commit is contained in:
parent
c0b78a9720
commit
146646c4d4
41 changed files with 239 additions and 233 deletions
|
@ -57,7 +57,7 @@ class Emailer
|
|||
.rand(10000, 99999);
|
||||
|
||||
// generate a multipart/alternative message header
|
||||
$messageHeader = defaults($params, 'additionalMailHeader', '') .
|
||||
$messageHeader = ($params['additionalMailHeader'] ?? '') .
|
||||
"From: $fromName <{$params['fromEmail']}>\n" .
|
||||
"Reply-To: $fromName <{$params['replyTo']}>\n" .
|
||||
"MIME-Version: 1.0\n" .
|
||||
|
|
|
@ -104,7 +104,7 @@ class Network
|
|||
|
||||
$parts2 = [];
|
||||
$parts = parse_url($url);
|
||||
$path_parts = explode('/', defaults($parts, 'path', ''));
|
||||
$path_parts = explode('/', $parts['path'] ?? '');
|
||||
foreach ($path_parts as $part) {
|
||||
if (strlen($part) <> mb_strlen($part)) {
|
||||
$parts2[] = rawurlencode($part);
|
||||
|
@ -801,8 +801,8 @@ class Network
|
|||
$i = 0;
|
||||
$path = "";
|
||||
do {
|
||||
$path1 = defaults($pathparts1, $i, '');
|
||||
$path2 = defaults($pathparts2, $i, '');
|
||||
$path1 = $pathparts1[$i] ?? '';
|
||||
$path2 = $pathparts2[$i] ?? '';
|
||||
|
||||
if ($path1 == $path2) {
|
||||
$path .= $path1."/";
|
||||
|
|
|
@ -141,7 +141,7 @@ class ParseUrl
|
|||
}
|
||||
|
||||
// If the file is too large then exit
|
||||
if (defaults($curlResult->getInfo(), 'download_content_length', 0) > 1000000) {
|
||||
if (($curlResult->getInfo()['download_content_length'] ?? 0) > 1000000) {
|
||||
return $siteinfo;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class Profiler implements ContainerInterface
|
|||
return;
|
||||
}
|
||||
|
||||
$duration = (float) (microtime(true) - $timestamp);
|
||||
$duration = floatval(microtime(true) - $timestamp);
|
||||
|
||||
if (!isset($this->performance[$value])) {
|
||||
// Prevent ugly E_NOTICE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue