From c7a7658316b08ba9da28e1e8b4c3c02fabb4de16 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 9 Jan 2018 22:20:58 -0500 Subject: [PATCH] Fix documentation in include/dba --- include/dba.php | 27 ++++++++++++++------------- mod/admin.php | 2 -- mod/cal.php | 2 +- mod/xrd.php | 3 ++- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/dba.php b/include/dba.php index 3a72d59649..2b8d3d7fc7 100644 --- a/include/dba.php +++ b/include/dba.php @@ -313,7 +313,7 @@ class dba { * For all regular queries please use dba::select or dba::exists * * @param string $sql SQL statement - * @return object statement object + * @return bool|object statement object */ public static function p($sql) { $a = get_app(); @@ -586,10 +586,11 @@ class dba { } /** - * @brief Fetches the first row - * - * Please use dba::select or dba::exists whenever this is possible. + * Fetches the first row + * + * Please use dba::selectOne or dba::exists whenever this is possible. * + * @brief Fetches the first row * @param string $sql SQL statement * @return array first row of query */ @@ -639,7 +640,7 @@ class dba { /** * @brief Returns the number of rows of a statement * - * @param object Statement object + * @param PDOStatement|mysqli_result|mysqli_stmt Statement object * @return int Number of rows */ public static function num_rows($stmt) { @@ -658,7 +659,7 @@ class dba { /** * @brief Fetch a single row * - * @param object $stmt statement object + * @param PDOStatement|mysqli_result|mysqli_stmt $stmt statement object * @return array current row */ public static function fetch($stmt) { @@ -1111,12 +1112,12 @@ class dba { /** * @brief Select rows from a table * - * @param string $table Table name - * @param array $fields array of selected fields - * @param array $condition array of fields for condition - * @param array $params array of several parameters + * @param string $table Table name + * @param array $fields Array of selected fields, empty for all + * @param array $condition Array of fields for condition + * @param array $params Array of several parameters * - * @return boolean|object If "limit" is equal "1" only a single row is returned, else a query object is returned + * @return boolean|object * * Example: * $table = "item"; @@ -1126,7 +1127,7 @@ class dba { * or: * $condition = array("`uid` = ? AND `network` IN (?, ?)", 1, 'dfrn', 'dspr'); * - * $params = array("order" => array("id", "received" => true), "limit" => 1); + * $params = array("order" => array("id", "received" => true), "limit" => 10); * * $data = dba::select($table, $fields, $condition, $params); */ @@ -1280,7 +1281,7 @@ class dba { * @brief Closes the current statement * * @param object $stmt statement object - * @return boolean was the close successfull? + * @return boolean was the close successful? */ public static function close($stmt) { if (!is_object($stmt)) { diff --git a/mod/admin.php b/mod/admin.php index 952956440a..0146b954f7 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1625,8 +1625,6 @@ function admin_page_users(App $a) ORDER BY $sql_order $sql_order_direction LIMIT %d, %d", intval($a->pager['start']), intval($a->pager['itemspage']) ); - //echo "
$users"; killme();
-
 	$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
 	$_setup_users = function ($e) use ($adminlist) {
 		$accounts = array(
diff --git a/mod/cal.php b/mod/cal.php
index 5cfa0466fe..cc1708352e 100644
--- a/mod/cal.php
+++ b/mod/cal.php
@@ -6,10 +6,10 @@
  * 	This calendar is for profile visitors and contains only the events
  * 	of the profile owner
  */
+
 use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Core\Config;
-use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Database\DBM;
 use Friendica\Model\Contact;
diff --git a/mod/xrd.php b/mod/xrd.php
index 7b1af2a190..871f24481d 100644
--- a/mod/xrd.php
+++ b/mod/xrd.php
@@ -29,8 +29,9 @@ function xrd_init(App $a)
 		$name = ltrim(basename($uri), '~');
 	} else {
 		$local = str_replace('acct:', '', $uri);
-		if (substr($local, 0, 2) == '//')
+		if (substr($local, 0, 2) == '//') {
 			$local = substr($local, 2);
+		}
 
 		$name = substr($local, 0, strpos($local, '@'));
 	}
-- 
2.39.5