mirror of
https://github.com/friendica/friendica
synced 2024-12-22 22:00:16 +00:00
Fix various documentation issues/unused variables
This commit is contained in:
parent
8a0e4e12e1
commit
dea1a98a5d
5 changed files with 29 additions and 34 deletions
|
@ -129,7 +129,6 @@ function group_content(App $a) {
|
|||
|
||||
$members = [];
|
||||
$preselected = [];
|
||||
$entry = [];
|
||||
|
||||
$context = $context + [
|
||||
'$title' => $group['name'],
|
||||
|
@ -191,8 +190,6 @@ function group_content(App $a) {
|
|||
$group = $r[0];
|
||||
$members = Model\Contact::getByGroupId($group['id']);
|
||||
$preselected = [];
|
||||
$entry = [];
|
||||
$id = 0;
|
||||
|
||||
if (count($members)) {
|
||||
foreach ($members as $member) {
|
||||
|
|
|
@ -912,7 +912,7 @@ function item_content(App $a)
|
|||
* the appropiate link.
|
||||
*
|
||||
* @param App $a Application instance @TODO is unused in this function's scope (excluding included files)
|
||||
* @param unknown_type $body the text to replace the tag in
|
||||
* @param string $body the text to replace the tag in
|
||||
* @param string $inform a comma-seperated string containing everybody to inform
|
||||
* @param string $str_tags string to add the tag to
|
||||
* @param integer $profile_uid
|
||||
|
|
|
@ -351,8 +351,6 @@ class Group extends BaseObject
|
|||
*/
|
||||
public static function sidebarWidget($every = 'contact', $each = 'group', $editmode = 'standard', $group_id = '', $cid = 0)
|
||||
{
|
||||
$o = '';
|
||||
|
||||
if (!local_user()) {
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -1238,8 +1238,6 @@ class Item extends BaseObject
|
|||
|
||||
public static function insert($item, $force_parent = false, $notify = false, $dontcache = false)
|
||||
{
|
||||
$a = \get_app();
|
||||
|
||||
// If it is a posting where users should get notifications, then define it as wall posting
|
||||
if ($notify) {
|
||||
$item['wall'] = 1;
|
||||
|
@ -1883,6 +1881,7 @@ class Item extends BaseObject
|
|||
* @brief Insert a new item content entry
|
||||
*
|
||||
* @param array $item The item fields that are to be inserted
|
||||
* @return bool
|
||||
*/
|
||||
private static function insertActivity(&$item)
|
||||
{
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Friendica\Object;
|
|||
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -16,6 +15,7 @@ use Friendica\Core\Protocol;
|
|||
use Friendica\Core\Renderer;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Conversation;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Term;
|
||||
use Friendica\Util\Crypto;
|
||||
|
@ -38,8 +38,15 @@ class Post extends BaseObject
|
|||
private $comment_box_template = 'comment_item.tpl';
|
||||
private $toplevel = false;
|
||||
private $writable = false;
|
||||
/**
|
||||
* @var Post[]
|
||||
*/
|
||||
private $children = [];
|
||||
private $parent = null;
|
||||
|
||||
/**
|
||||
* @var Thread
|
||||
*/
|
||||
private $thread = null;
|
||||
private $redirect_url = null;
|
||||
private $owner_url = '';
|
||||
|
@ -56,8 +63,6 @@ class Post extends BaseObject
|
|||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
$this->data = $data;
|
||||
$this->setTemplate('wall');
|
||||
$this->toplevel = $this->getId() == $this->getDataValue('parent');
|
||||
|
@ -105,16 +110,14 @@ class Post extends BaseObject
|
|||
/**
|
||||
* Get data in a form usable by a conversation template
|
||||
*
|
||||
* @param object $conv_responses conversation responses
|
||||
* @param array $conv_responses conversation responses
|
||||
* @param integer $thread_level default = 1
|
||||
*
|
||||
* @return mixed The data requested on success
|
||||
* false on failure
|
||||
*/
|
||||
public function getTemplateData($conv_responses, $thread_level = 1)
|
||||
public function getTemplateData(array $conv_responses, $thread_level = 1)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
$a = self::getApp();
|
||||
|
||||
$item = $this->getData();
|
||||
|
@ -131,7 +134,6 @@ class Post extends BaseObject
|
|||
'relative' => Temporal::getRelativeDate($item['edited'])
|
||||
];
|
||||
}
|
||||
$commentww = '';
|
||||
$sparkle = '';
|
||||
$buttons = '';
|
||||
$dropping = false;
|
||||
|
@ -486,7 +488,7 @@ class Post extends BaseObject
|
|||
/**
|
||||
* Add a child item
|
||||
*
|
||||
* @param object $item The child item to add
|
||||
* @param Post $item The child item to add
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -536,7 +538,7 @@ class Post extends BaseObject
|
|||
/**
|
||||
* Get all our children
|
||||
*
|
||||
* @return object
|
||||
* @return Post[]
|
||||
*/
|
||||
public function getChildren()
|
||||
{
|
||||
|
@ -546,11 +548,11 @@ class Post extends BaseObject
|
|||
/**
|
||||
* Set our parent
|
||||
*
|
||||
* @param object $item The item to set as parent
|
||||
* @param Post $item The item to set as parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setParent($item)
|
||||
protected function setParent(Post $item)
|
||||
{
|
||||
$parent = $this->getParent();
|
||||
if ($parent) {
|
||||
|
@ -575,11 +577,11 @@ class Post extends BaseObject
|
|||
/**
|
||||
* Remove a child
|
||||
*
|
||||
* @param object $item The child to be removed
|
||||
* @param Post $item The child to be removed
|
||||
*
|
||||
* @return boolean Success or failure
|
||||
*/
|
||||
public function removeChild($item)
|
||||
public function removeChild(Post $item)
|
||||
{
|
||||
$id = $item->getId();
|
||||
foreach ($this->getChildren() as $key => $child) {
|
||||
|
@ -606,28 +608,26 @@ class Post extends BaseObject
|
|||
}
|
||||
|
||||
/**
|
||||
* Set conversation
|
||||
* Set conversation thread
|
||||
*
|
||||
* @param object $conv The conversation
|
||||
* @param Thread $thread
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setThread($conv)
|
||||
public function setThread(Thread $thread = null)
|
||||
{
|
||||
$previous_mode = ($this->thread ? $this->thread->getMode() : '');
|
||||
|
||||
$this->thread = $conv;
|
||||
$this->thread = $thread;
|
||||
|
||||
// Set it on our children too
|
||||
foreach ($this->getChildren() as $child) {
|
||||
$child->setThread($conv);
|
||||
$child->setThread($thread);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get conversation
|
||||
*
|
||||
* @return object
|
||||
* @return Thread
|
||||
*/
|
||||
public function getThread()
|
||||
{
|
||||
|
@ -649,7 +649,7 @@ class Post extends BaseObject
|
|||
/**
|
||||
* Get a data value
|
||||
*
|
||||
* @param object $name key
|
||||
* @param string $name key
|
||||
*
|
||||
* @return mixed value on success
|
||||
* false on failure
|
||||
|
@ -667,9 +667,8 @@ class Post extends BaseObject
|
|||
/**
|
||||
* Set template
|
||||
*
|
||||
* @param object $name template name
|
||||
*
|
||||
* @return void
|
||||
* @param string $name template name
|
||||
* @return bool
|
||||
*/
|
||||
private function setTemplate($name)
|
||||
{
|
||||
|
@ -679,6 +678,8 @@ class Post extends BaseObject
|
|||
}
|
||||
|
||||
$this->template = $this->available_templates[$name];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue