mirror of
https://github.com/friendica/friendica
synced 2025-04-26 05:10:11 +00: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
|
@ -39,7 +39,7 @@ class Conversation
|
|||
*/
|
||||
public static function insert(array $arr)
|
||||
{
|
||||
if (in_array(defaults($arr, 'network', Protocol::PHANTOM),
|
||||
if (in_array(($arr['network'] ?? '') ?: Protocol::PHANTOM,
|
||||
[Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, Protocol::TWITTER]) && !empty($arr['uri'])) {
|
||||
$conversation = ['item-uri' => $arr['uri'], 'received' => DateTimeFormat::utcNow()];
|
||||
|
||||
|
@ -76,8 +76,13 @@ class Conversation
|
|||
unset($old_conv['source']);
|
||||
}
|
||||
// Update structure data all the time but the source only when its from a better protocol.
|
||||
if (empty($conversation['source']) || (!empty($old_conv['source']) &&
|
||||
($old_conv['protocol'] < defaults($conversation, 'protocol', self::PARCEL_UNKNOWN)))) {
|
||||
if (
|
||||
empty($conversation['source'])
|
||||
|| (
|
||||
!empty($old_conv['source'])
|
||||
&& ($old_conv['protocol'] < (($conversation['protocol'] ?? '') ?: self::PARCEL_UNKNOWN))
|
||||
)
|
||||
) {
|
||||
unset($conversation['protocol']);
|
||||
unset($conversation['source']);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue