Continued:

- avoided else() block which reduces code complexibility
- used more x()
- added curly braces
- added known type-hints

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2018-05-10 14:48:27 +02:00
parent e0a07d5f27
commit 57e668d9e0
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
8 changed files with 48 additions and 38 deletions

View file

@ -803,10 +803,10 @@ class Event extends BaseObject
/**
* @brief Format an item array with event data to HTML.
*
* @param arr $item Array with item and event data.
* @param array $item Array with item and event data.
* @return string HTML output.
*/
public static function getItemHTML($item) {
public static function getItemHTML(array $item) {
$same_date = false;
$finish = false;

View file

@ -1032,8 +1032,9 @@ class Item extends BaseObject
}
// Is this a shadow entry?
if ($item['uid'] == 0)
if ($item['uid'] == 0) {
return;
}
// Is there a shadow parent?
if (!dba::exists('item', ['uri' => $item['parent-uri'], 'uid' => 0])) {
@ -1073,10 +1074,8 @@ class Item extends BaseObject
// If this was a comment to a Diaspora post we don't get our comment back.
// This means that we have to distribute the comment by ourselves.
if ($origin) {
if (dba::exists('item', ['id' => $parent, 'network' => NETWORK_DIASPORA])) {
self::distribute($public_shadow);
}
if ($origin && dba::exists('item', ['id' => $parent, 'network' => NETWORK_DIASPORA])) {
self::distribute($public_shadow);
}
}
@ -1087,14 +1086,14 @@ class Item extends BaseObject
*/
private static function addLanguageInPostopts(&$item)
{
$postopts = "";
if (!empty($item['postopts'])) {
if (strstr($item['postopts'], 'lang=')) {
// do not override
return;
}
$postopts = $item['postopts'];
} else {
$postopts = "";
}
$naked_body = Text\BBCode::toPlaintext($item['body'], false);