From 3df5c171248d1d27cd4026b6a87ac0824abb3f66 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Fri, 25 Dec 2015 23:17:34 +0100 Subject: [PATCH] reformat todo according to doxygen style --- include/Contact.php | 7 ++-- include/Photo.php | 6 +-- include/api.php | 34 ++++++++--------- include/cron.php | 2 +- include/datetime.php | 2 +- include/dba.php | 3 +- include/diaspora.php | 21 ++++++----- include/email.php | 4 +- include/feed.php | 2 +- include/items.php | 33 ++++++++-------- include/msgclean.php | 6 +-- include/network.php | 2 +- include/notifier.php | 2 +- include/onepoll.php | 7 ++-- include/ostatus.php | 37 +++++++++--------- include/plaintext.php | 4 +- include/poller.php | 4 +- include/socgraph.php | 17 +++++---- include/uimport.php | 4 +- mod/api.php | 2 +- mod/directory.php | 4 +- mod/item.php | 4 -- mod/network.php | 6 +-- mod/parse_url.php | 28 ++++++++------ mod/uimport.php | 2 +- tests/autoname_test.php | 84 ++++++++++++++++++++--------------------- 26 files changed, 164 insertions(+), 163 deletions(-) diff --git a/include/Contact.php b/include/Contact.php index 340b3ec6fa..a3cbbfed15 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -159,9 +159,10 @@ function mark_for_death($contact) { } else { - // TODO: We really should send a notification to the owner after 2-3 weeks - // so they won't be surprised when the contact vanishes and can take - // remedial action if this was a serious mistake or glitch + /// @todo + /// We really should send a notification to the owner after 2-3 weeks + /// so they won't be surprised when the contact vanishes and can take + /// remedial action if this was a serious mistake or glitch $expiry = $contact['term-date'] . ' + 32 days '; if(datetime_convert() > datetime_convert('UTC','UTC',$expiry)) { diff --git a/include/Photo.php b/include/Photo.php index 9732801c9a..30424747da 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -873,9 +873,9 @@ function store_photo($a, $uid, $imagedata = "", $url = "") { $page_owner_nick = $r[0]['nickname']; -// To-Do: -// $default_cid = $r[0]['id']; -// $community_page = (($r[0]['page-flags'] == PAGE_COMMUNITY) ? true : false); + /// @TODO + /// $default_cid = $r[0]['id']; + /// $community_page = (($r[0]['page-flags'] == PAGE_COMMUNITY) ? true : false); if ((strlen($imagedata) == 0) AND ($url == "")) { logger("No image data and no url provided", LOGGER_DEBUG); diff --git a/include/api.php b/include/api.php index ff8127829b..7002206729 100644 --- a/include/api.php +++ b/include/api.php @@ -1,7 +1,9 @@ ".$error."".$a->query_string.""; switch($type){ case "xml": @@ -880,7 +882,7 @@ $_REQUEST['body'] .= "\n\n".$media; } - // To-Do: Multiple IDs + /// @TODO Multiple IDs if (requestdata('media_ids')) { $r = q("SELECT `resource-id`, `scale`, `nickname`, `type` FROM `photo` INNER JOIN `user` ON `user`.`uid` = `photo`.`uid` WHERE `resource-id` IN (SELECT `resource-id` FROM `photo` WHERE `id` = %d) AND `scale` > 0 AND `photo`.`uid` = %d ORDER BY `photo`.`width` DESC LIMIT 1", intval(requestdata('media_ids')), api_user()); @@ -1192,8 +1194,8 @@ * * http://developer.twitter.com/doc/get/statuses/home_timeline * - * TODO: Optional parameters - * TODO: Add reply info + * @TODO Optional parameters + * @TODO Add reply info */ function api_statuses_home_timeline(&$a, $type){ if (api_user()===false) return false; @@ -1725,8 +1727,8 @@ function api_favorites_create_destroy(&$a, $type){ if (api_user()===false) return false; - # for versioned api. - # TODO: we need a better global soluton + // for versioned api. + /// @TODO We need a better global soluton $action_argv_id=2; if ($a->argv[1]=="1.1") $action_argv_id=3; @@ -2013,10 +2015,8 @@ } function api_get_entitities(&$text, $bbcode) { - /* - To-Do: - * Links at the first character of the post - */ + /// @todo + /// Links at the first character of the post $a = get_app(); @@ -2871,10 +2871,8 @@ function api_share_as_retweet(&$item) { } function api_get_nick($profile) { -/* To-Do: - - remove trailing junk from profile url - - pump.io check has to check the website -*/ +/// @TODO Remove trailing junk from profile url +/// @TODO pump.io check has to check the website $nick = ""; @@ -2922,7 +2920,7 @@ function api_get_nick($profile) { } } - // To-Do: look at the page if its really a pumpio site + /// @TODO Look at the page if its really a pumpio site //if (!$nick == "") { // $pumpio = preg_replace("=https?://(.*)/(.*)/=ism", "$2", $profile."/"); // if ($pumpio != $profile) diff --git a/include/cron.php b/include/cron.php index 18674817d3..a6e81f6bfd 100644 --- a/include/cron.php +++ b/include/cron.php @@ -140,7 +140,7 @@ function cron_run(&$argv, &$argc){ // update nodeinfo data nodeinfo_cron(); - // To-Do: Regenerate usage statistics + /// @TODO Regenerate usage statistics // q("ANALYZE TABLE `item`"); // once daily run birthday_updates and then expire in background diff --git a/include/datetime.php b/include/datetime.php index 79964ef404..a05af5e38f 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -377,7 +377,7 @@ function get_first_dim($y,$m) { // Months count from 1. -// TODO: provide (prev,next) links, define class variations for different size calendars +/// @TODO Provide (prev,next) links, define class variations for different size calendars if(! function_exists('cal')) { diff --git a/include/dba.php b/include/dba.php index c66723033c..cae045d874 100644 --- a/include/dba.php +++ b/include/dba.php @@ -14,8 +14,7 @@ if(class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) { require_once('include/datetime.php'); /** - * - * MySQL database class + * @class MySQL database class * * For debugging, insert 'dbg(1);' anywhere in the program flow. * dbg(0); will turn it off. Logging is performed at LOGGER_DATA level. diff --git a/include/diaspora.php b/include/diaspora.php index e0eaf065d6..f74e7ca178 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1,9 +1,10 @@ Ausland // diff --git a/include/items.php b/include/items.php index eff1366899..e8905ae256 100644 --- a/include/items.php +++ b/include/items.php @@ -1097,10 +1097,13 @@ function add_guid($item) { dbesc($item["uri"]), dbesc($item["network"])); } -// Adds a "lang" specification in a "postopts" element of given $arr, -// if possible and not already present. -// Expects "body" element to exist in $arr. -// TODO: add a parameter to request forcing override +/** + * Adds a "lang" specification in a "postopts" element of given $arr, + * if possible and not already present. + * Expects "body" element to exist in $arr. + * + * @todo Add a parameter to request forcing override + */ function item_add_language_opt(&$arr) { if (version_compare(PHP_VERSION, '5.3.0', '<')) return; // LanguageDetect.php not available ? @@ -1110,7 +1113,7 @@ function item_add_language_opt(&$arr) { if ( strstr($arr['postopts'], 'lang=') ) { // do not override - // TODO: add parameter to request overriding + /// @TODO Add parameter to request overriding return; } $postopts = $arr['postopts']; @@ -3228,11 +3231,11 @@ function local_delivery($importer,$data) { return 1; } - // TODO - // merge with current record, current contents have priority - // update record, set url-updated - // update profile photos - // schedule a scan? + /// @TODO + /// merge with current record, current contents have priority + /// update record, set url-updated + /// update profile photos + /// schedule a scan? return 0; } @@ -4515,11 +4518,11 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { $o .= '' . "\r\n"; } - // To-Do: - // To support these elements, the API needs to be enhanced - //$o .= ''."\r\n"; - //$o .= "\t".''."\r\n"; - //$o .= "\t".''."\r\n"; + /// @TODO + /// To support these elements, the API needs to be enhanced + /// $o .= ''."\r\n"; + /// $o .= "\t".''."\r\n"; + /// $o .= "\t".''."\r\n"; // Deactivated since it was meant only for OStatus //$o .= item_get_attachment($item); diff --git a/include/msgclean.php b/include/msgclean.php index eabb47788a..3b5ed5487d 100644 --- a/include/msgclean.php +++ b/include/msgclean.php @@ -127,9 +127,9 @@ function removesig($message) if (($sigpos < $quotepos) and ($sigpos != 0)) return(array('body' => $message, 'sig' => '')); - // To-Do: Regexp umstellen, so dass auf 1 oder kein Leerzeichen - // geprueft wird - //$message = str_replace("\n--\n", "\n-- \n", $message); + /// @TODO Regexp umstellen, so dass auf 1 oder kein Leerzeichen + /// geprueft wird + /// $message = str_replace("\n--\n", "\n-- \n", $message); $pattern = '/(.*)[\r\n]-- [\r\n](.*)/is'; diff --git a/include/network.php b/include/network.php index d0217e2a08..ac5191b259 100644 --- a/include/network.php +++ b/include/network.php @@ -587,7 +587,7 @@ function lrdd($uri, $debug = false) { $lines = explode("\n",$headers); if(count($lines)) { foreach($lines as $line) { - // TODO alter the following regex to support multiple relations (space separated) + /// @TODO Alter the following regex to support multiple relations (space separated) if((stristr($line,'link:')) && preg_match('/<([^>].*)>.*rel\=[\'\"]lrdd[\'\"]/',$line,$matches)) { $pagelink = $matches[1]; break; diff --git a/include/notifier.php b/include/notifier.php index ec2b666bed..6fbbadb968 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -966,7 +966,7 @@ function notifier_run(&$argv, &$argc){ if($url) { logger('notifier: urldelivery: ' . $url); $deliver_status = slapper($owner,$url,$slap); - // TODO: redeliver/queue these items on failure, though there is no contact record + /// @TODO Redeliver/queue these items on failure, though there is no contact record } } } diff --git a/include/onepoll.php b/include/onepoll.php index 6ff7eae422..516f1dfd4d 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -109,9 +109,8 @@ function onepoll_run(&$argv, &$argc){ poco_load($contact['id'],$importer_uid,0,$contact['poco']); } - // To-Do: - // - Check why we don't poll the Diaspora feed at the moment (some guid problem in the items?) - // - Check whether this is possible with Redmatrix + /// @TODO Check why we don't poll the Diaspora feed at the moment (some guid problem in the items?) + /// @TODO Check whether this is possible with Redmatrix if ($contact["network"] == NETWORK_DIASPORA) { if (poco_do_update($contact["created"], $contact["last-item"], $contact["failure_update"], $contact["success_update"])) { $last_updated = poco_last_updated($contact["url"]); @@ -507,7 +506,7 @@ function onepoll_run(&$argv, &$argc){ logger("Mail: Importing ".$msg_uid." for ".$mailconf[0]['user']); // some mailing lists have the original author as 'from' - add this sender info to msg body. - // todo: adding a gravatar for the original author would be cool + /// @TODO Adding a gravatar for the original author would be cool if(! stristr($meta->from,$contact['addr'])) { $from = imap_mime_header_decode($meta->from); diff --git a/include/ostatus.php b/include/ostatus.php index bcaef4f439..7df9b2e6b8 100644 --- a/include/ostatus.php +++ b/include/ostatus.php @@ -298,8 +298,8 @@ function ostatus_import($xml,$importer,&$contact, &$hub) { $item["object"] = $xml; $item["verb"] = $xpath->query('activity:verb/text()', $entry)->item(0)->nodeValue; - // To-Do: - // Delete a message + /// @TODO + /// Delete a message if ($item["verb"] == "qvitter-delete-notice") { // ignore "Delete" messages (by now) logger("Ignore delete message ".print_r($item, true)); @@ -361,8 +361,8 @@ function ostatus_import($xml,$importer,&$contact, &$hub) { if ($georsspoint) $item["coord"] = $georsspoint->item(0)->nodeValue; - // To-Do - // $item["location"] = + /// @TODO + /// $item["location"] = $categories = $xpath->query('atom:category', $entry); if ($categories) { @@ -833,7 +833,7 @@ function ostatus_completion($conversation_url, $uid, $item = array()) { $existing_message = $message_exists[0]; // We improved the way we fetch OStatus messages, this shouldn't happen very often now - // To-Do: we have to change the shadow copies as well. This way here is really ugly. + /// @TODO We have to change the shadow copies as well. This way here is really ugly. if ($existing_message["parent"] != $parent["id"]) { logger('updating id '.$existing_message["id"].' with parent '.$existing_message["parent"].' to parent '.$parent["id"].' uri '.$parent["uri"].' thread '.$parent_uri, LOGGER_DEBUG); @@ -886,7 +886,7 @@ function ostatus_completion($conversation_url, $uid, $item = array()) { logger("No contact found for url ".$actor, LOGGER_DEBUG); // Adding a global contact - // To-Do: Use this data for the post + /// @TODO Use this data for the post $global_contact_id = get_contact($actor, 0); logger("Global contact ".$global_contact_id." found for url ".$actor, LOGGER_DEBUG); @@ -1153,11 +1153,11 @@ function ostatus_add_header($doc, $owner) { $attributes = array("href" => $owner["url"], "rel" => "alternate", "type" => "text/html"); xml_add_element($doc, $root, "link", "", $attributes); - // To-Do: We have to find out what this is - //$attributes = array("href" => $a->get_baseurl()."/sup", - // "rel" => "http://api.friendfeed.com/2008/03#sup", - // "type" => "application/json"); - //xml_add_element($doc, $root, "link", "", $attributes); + /// @TODO We have to find out what this is + /// $attributes = array("href" => $a->get_baseurl()."/sup", + /// "rel" => "http://api.friendfeed.com/2008/03#sup", + /// "type" => "application/json"); + /// xml_add_element($doc, $root, "link", "", $attributes); ostatus_hublinks($doc, $root); @@ -1311,12 +1311,11 @@ function ostatus_add_author($doc, $owner, $profile) { return $author; } -/* -To-Do: Picture attachments should look like this: - -https://status.pirati.ca/attachment/572819 - +/** + * @TODO Picture attachments should look like this: + * https://status.pirati.ca/attachment/572819 + * */ function ostatus_entry($doc, $item, $owner, $toplevel = false) { @@ -1461,8 +1460,8 @@ function ostatus_entry($doc, $item, $owner, $toplevel = false) { ostatus_get_attachment($doc, $entry, $item); - // To-Do: - // The API call has yet to be implemented + /// @TODO + /// The API call has yet to be implemented //$attributes = array("href" => $a->get_baseurl()."/api/statuses/show/".$item["id"].".atom", // "rel" => "self", "type" => "application/atom+xml"); //xml_add_element($doc, $entry, "link", "", $attributes); diff --git a/include/plaintext.php b/include/plaintext.php index 204feb137f..cb56850d4f 100644 --- a/include/plaintext.php +++ b/include/plaintext.php @@ -106,8 +106,8 @@ function get_attached_data($body) { } function shortenmsg($msg, $limit, $twitter = false) { - // To-Do: - // For Twitter URLs aren't shortened, but they have to be calculated as if. + /// @TODO + /// For Twitter URLs aren't shortened, but they have to be calculated as if. $lines = explode("\n", $msg); $msg = ""; diff --git a/include/poller.php b/include/poller.php index b1d6099ad3..c681bfb389 100644 --- a/include/poller.php +++ b/include/poller.php @@ -56,8 +56,8 @@ function poller_run(&$argv, &$argc){ q("UPDATE `workerqueue` SET `executed` = '0000-00-00 00:00:00', `pid` = 0 WHERE `pid` = %d", intval($pid["pid"])); else { - // To-Do: Kill long running processes - // But: Update processes (like the database update) mustn't be killed + /// @TODO Kill long running processes + /// But: Update processes (like the database update) mustn't be killed } } else diff --git a/include/socgraph.php b/include/socgraph.php index 559b1832b2..89b09515ed 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -1,15 +1,16 @@ get_baseurl() . '/poco'); $done[] = $a->get_baseurl() . '/poco'; diff --git a/include/uimport.php b/include/uimport.php index 78471af151..bd271e91a8 100644 --- a/include/uimport.php +++ b/include/uimport.php @@ -195,10 +195,10 @@ function import_account(&$a, $file) { // send relocate message (below) break; case NETWORK_ZOT: - // TODO handle zot network + /// @TODO handle zot network break; case NETWORK_MAIL2: - // TODO ? + /// @TODO ? break; case NETWORK_FEED: case NETWORK_MAIL: diff --git a/mod/api.php b/mod/api.php index e3b5ea3a92..da2c40c305 100644 --- a/mod/api.php +++ b/mod/api.php @@ -85,7 +85,7 @@ function api_content(&$a) { if(! local_user()) { - //TODO: we need login form to redirect to this page + /// @TODO We need login form to redirect to this page notice( t('Please login to continue.') . EOL ); return login(false,$request->get_parameters()); } diff --git a/mod/directory.php b/mod/directory.php index 484858f34d..294a55585d 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -130,8 +130,8 @@ function directory_content(&$a) { // show if account is a community account - // ToDo the other should be also respected, but first we need a good translatiion - // and systemwide consistency for displaying the page type + /// @TODO The other page types should be also respected, but first we need a good + /// translatiion and systemwide consistency for displaying the page type if((intval($rr['page-flags']) == PAGE_COMMUNITY) OR (intval($rr['page-flags']) == PAGE_PRVGROUP)) $community = true; diff --git a/mod/item.php b/mod/item.php index a2b88a8e30..f25ea36b2c 100644 --- a/mod/item.php +++ b/mod/item.php @@ -176,10 +176,6 @@ function item_post(&$a) { // have been provided, and run any anti-spam plugins - // TODO - - - if((! can_write_wall($a,$profile_uid)) && (! $allow_moderated)) { notice( t('Permission denied.') . EOL) ; diff --git a/mod/network.php b/mod/network.php index 8e7a2b8e1e..a85e498db2 100644 --- a/mod/network.php +++ b/mod/network.php @@ -312,7 +312,7 @@ function network_content(&$a, $update = 0) { return login(false); } - // TODO:is this really necessary? $a is already available to hooks + /// @TODO Is this really necessary? $a is already available to hooks $arr = array('query' => $a->query_string); call_hooks('network_content_init', $arr); @@ -346,8 +346,8 @@ function network_content(&$a, $update = 0) { $o = ''; // item filter tabs - // TODO: fix this logic, reduce duplication - //$a->page['content'] .= '
'; + /// @TODO fix this logic, reduce duplication + /// $a->page['content'] .= '
'; list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active) = network_query_get_sel_tab($a); // if no tabs are selected, defaults to comments diff --git a/mod/parse_url.php b/mod/parse_url.php index ef051d9f6b..28869b4c12 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -1,16 +1,20 @@ - - - - -

Shiny Trinket

- -

Shiny trinkets are shiny.

- +/** + * @file mod/parse_url.php + * + * @todo https://developers.google.com/+/plugins/snippet/ + * + * @verbatim + * + * + * + * + * + *

Shiny Trinket

+ * + *

Shiny trinkets are shiny.

+ * + * @endverbatim */ if(!function_exists('deletenode')) { diff --git a/mod/uimport.php b/mod/uimport.php index ffa4f3ed72..7ed5648d9e 100644 --- a/mod/uimport.php +++ b/mod/uimport.php @@ -29,7 +29,7 @@ function uimport_post(&$a) { } if (x($_FILES,'accountfile')){ - // TODO: pass $blocked / $verified, send email to admin on REGISTER_APPROVE + /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE import_account($a, $_FILES['accountfile']); return; } diff --git a/tests/autoname_test.php b/tests/autoname_test.php index 702e05befc..03a7ebfe96 100644 --- a/tests/autoname_test.php +++ b/tests/autoname_test.php @@ -15,62 +15,62 @@ require_once('include/text.php'); * @package test.util */ class AutonameTest extends PHPUnit_Framework_TestCase { - /** - *autonames should be random, even length - */ - public function testAutonameEven() { - $autoname1=autoname(10); - $autoname2=autoname(10); - - $this->assertNotEquals($autoname1, $autoname2); - } - - /** - *autonames should be random, odd length - */ - public function testAutonameOdd() { - $autoname1=autoname(9); - $autoname2=autoname(9); - - $this->assertNotEquals($autoname1, $autoname2); - } - - /** - * try to fail autonames - */ - public function testAutonameNoLength() { - $autoname1=autoname(0); - $this->assertEquals(0, strlen($autoname1)); - } + /** + *autonames should be random, even length + */ + public function testAutonameEven() { + $autoname1=autoname(10); + $autoname2=autoname(10); + + $this->assertNotEquals($autoname1, $autoname2); + } + + /** + *autonames should be random, odd length + */ + public function testAutonameOdd() { + $autoname1=autoname(9); + $autoname2=autoname(9); + + $this->assertNotEquals($autoname1, $autoname2); + } + + /** + * try to fail autonames + */ + public function testAutonameNoLength() { + $autoname1=autoname(0); + $this->assertEquals(0, strlen($autoname1)); + } /** * try to fail it with invalid input * * TODO: What's corect behaviour here? An exception? - */ - public function testAutonameNegativeLength() { - $autoname1=autoname(-23); - $this->assertEquals(0, strlen($autoname1)); - } - - // public function testAutonameMaxLength() { - // $autoname2=autoname(PHP_INT_MAX); - // $this->assertEquals(PHP_INT_MAX, count($autoname2)); - // } + */ + public function testAutonameNegativeLength() { + $autoname1=autoname(-23); + $this->assertEquals(0, strlen($autoname1)); + } + + // public function testAutonameMaxLength() { + // $autoname2=autoname(PHP_INT_MAX); + // $this->assertEquals(PHP_INT_MAX, count($autoname2)); + // } /** * test with a length, that may be too short - */ - public function testAutonameLength1() { - $autoname1=autoname(1); + */ + public function testAutonameLength1() { + $autoname1=autoname(1); $this->assertEquals(1, count($autoname1)); - $autoname2=autoname(1); + $autoname2=autoname(1); $this->assertEquals(1, count($autoname2)); // The following test is problematic, with only 26 possibilities // generating the same thing twice happens often aka // birthday paradox -// $this->assertFalse($autoname1==$autoname2); +// $this->assertFalse($autoname1==$autoname2); } } \ No newline at end of file -- 2.39.5