From: Philipp Holzer Date: Sun, 26 May 2019 19:53:24 +0000 (+0200) Subject: added suggestions X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=26d4214c19b1ce158b61c027f63bec0cce341f1e;p=friendica.git added suggestions --- diff --git a/mod/uexport.php b/mod/uexport.php index 2580a4ac6e..dfeb25abd7 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -12,6 +12,7 @@ use Friendica\Database\DBA; use Friendica\Database\DBStructure; function uexport_init(App $a) { + /// @todo Don't forget to move this global field as static field in src/Modules global $dbStructure; if (!local_user()) { @@ -74,7 +75,7 @@ function _uexport_multirow($query) { foreach ($rr as $k => $v) { switch ($dbStructure[$table]['fields'][$k]['type']) { case 'datetime': - $p[$k] = !empty($v) ? $v : DBA::NULL_DATETIME; + $p[$k] = $v ?? DBA::NULL_DATETIME; break; default: $p[$k] = $v; @@ -101,7 +102,7 @@ function _uexport_row($query) { foreach ($rr as $k => $v) { switch ($dbStructure[$table]['fields'][$k]['type']) { case 'datetime': - $result[$k] = !empty($v) ? $v : DBA::NULL_DATETIME; + $result[$k] = $v ?? DBA::NULL_DATETIME; break; default: $result[$k] = $v; diff --git a/src/Core/UserImport.php b/src/Core/UserImport.php index 8d02fb420e..97a6e6028e 100644 --- a/src/Core/UserImport.php +++ b/src/Core/UserImport.php @@ -53,7 +53,7 @@ class UserImport } if ($ttype[$icol] === 'datetime') { - $arr[$icol] = !empty($ival) ? $ival : DBA::NULL_DATETIME; + $arr[$icol] = $ival ?? DBA::NULL_DATETIME; } } }