From 7364ec6124b63a71bd54c1693294665fa3e31543 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 8 Oct 2005 04:16:19 +0000 Subject: [PATCH] Cleaning up phpDoc variable declarations --- date.php | 10 +++--- db_mysql.php | 54 ++++++++++++++++---------------- functions.php | 42 ++++++++++++------------- kernel.php | 83 +++++++++++++++++++------------------------------ localize.php | 12 +++---- mail.php | 22 ++++++------- template.php | 36 ++++++++++----------- template_fs.php | 8 ++--- xml.php | 16 +++++----- 9 files changed, 132 insertions(+), 151 deletions(-) diff --git a/date.php b/date.php index 1f1bf60..f7cf3b7 100644 --- a/date.php +++ b/date.php @@ -52,26 +52,26 @@ class Date_Formatter { /** * User timezone offset - * @var int + * @var integer */ var $usertz = 0; /** * Server's timezone offset - * @var int + * @var integer */ var $servertz = 0; /** * Total offset timezone - * @var int + * @var integer * @see fetch_offset() */ var $offsettz = 0; /** * Offset in seconds - * @var int + * @var integer */ var $offset = 0; @@ -97,7 +97,7 @@ class Date_Formatter * Formats a UNIX timestamp to a certain date format in the proper time zone * * @param string Format of the date (same as PHP's date() function) - * @param int UNIX timestamp to format + * @param integer UNIX timestamp to format * @param bool Adjust the date to the user's language? * * @return string Formatted date diff --git a/db_mysql.php b/db_mysql.php index 5032ac6..67e4447 100644 --- a/db_mysql.php +++ b/db_mysql.php @@ -46,7 +46,7 @@ class MySQL_Database_Driver { /** * Database that is used in the application - * @var str + * @var string * @see connect() */ var $database = ''; @@ -60,35 +60,35 @@ class MySQL_Database_Driver /** * Current error number - * @var int + * @var integer * @see error() */ var $error_no = 0; /** * Description of current error - * @var str + * @var string * @see error() */ var $error_str = ''; /** * Currend open MySQL connexion - * @var res + * @var resource * @see connect() */ var $link_id = null; /** * Current query ID - * @var res + * @var integer * @see query() */ var $query_id = null; /** * Current query string - * @var str + * @var string * @see query() */ var $query_str = ''; @@ -102,9 +102,9 @@ class MySQL_Database_Driver /** * Connect to a the specified database * - * @param str Server name - * @param str User name - * @param str Password + * @param string Server name + * @param string User name + * @param string Password * @param bool Use p-connect? * * @return bool Result of connect @@ -143,13 +143,13 @@ class MySQL_Database_Driver /** * Send a query to MySQL * - * @param str Query string + * @param string Query string * - * @return res Resource ID for query + * @return integer Resource ID for query */ function query($query_str) { - $this->query_id = @mysql_query($query_str, $this->link_id); + $this->query_id = @mysql_query($query_string, $this->link_id); $this->query_str = $query_str; $this->history[] = $this->query_str; @@ -172,19 +172,19 @@ class MySQL_Database_Driver /** * Escape a string depending on character set * - * @param str String to be escaped + * @param string String to be escaped * - * @return str Escaped string + * @return string Escaped string */ function escape_string($string) { - return @mysql_real_escape_string($string, $this->link_id); + return @mysql_real_escape_stringing($string, $this->link_id); } /** * Fetch the query result as an array * - * @param res Query ID + * @param integer Query ID * * @return array A row of the query result */ @@ -196,9 +196,9 @@ class MySQL_Database_Driver /** * Fetch the query result as an object * - * @param res Query ID + * @param integer Query ID * - * @return obj An object with the query result + * @return object An object with the query result */ function fetch_object($query_id) { @@ -208,7 +208,7 @@ class MySQL_Database_Driver /** * Free the current MySQL query result * - * @param res Query ID + * @param integer Query ID */ function free_result($query_id) { @@ -220,8 +220,8 @@ class MySQL_Database_Driver /** * Send a MySQL query and return the first row of the results * - * @param str Query string - * @param str Result return function (in the database layer) + * @param string Query string + * @param string Result return function (in the database layer) * * @return mixed Results in variable formats */ @@ -236,7 +236,7 @@ class MySQL_Database_Driver /** * Fetch the unique ID of the record just inserted * - * @return int MySQL insert ID + * @return integer MySQL insert ID */ function insert_id() { @@ -246,9 +246,9 @@ class MySQL_Database_Driver /** * Fetch the number of rows in the result * - * @param res Query ID + * @param integer Query ID * - * @return int Number of MySQL rows + * @return integer Number of MySQL rows */ function num_rows($query_id) { @@ -258,9 +258,9 @@ class MySQL_Database_Driver /** * Fetch the number of rows affected by the query * - * @param res Query ID + * @param integer Query ID * - * @return int Number of affected rows + * @return integer Number of affected rows */ function affected_rows($query_id) { @@ -270,7 +270,7 @@ class MySQL_Database_Driver /** * MySQL error wrapper for ISSO::_message() * - * @param str User defined error message + * @param string User defined error message */ function error($message) { diff --git a/functions.php b/functions.php index f114cd4..639ab94 100644 --- a/functions.php +++ b/functions.php @@ -46,28 +46,28 @@ class Functions { /** * The path that is used to set cookies - * @var str + * @var string * @see cookie() */ var $cookiepath = '/'; /** * The domain used for cookie setting - * @var str + * @var string * @see cookie() */ var $cookiedom = ''; /** * The time it takes for a cookie to expire - * @var int + * @var integer * @see cookie() */ var $cookieexp = 900; /** * State of the current background colour during alternation - * @var str + * @var string * @see exec_swap_bg() */ var $bgcolour = ''; @@ -75,8 +75,8 @@ class Functions /** * Sets a cookie with a friendly interface * - * @param str The name of the cookie - * @param str Value of the cookie + * @param string The name of the cookie + * @param string Value of the cookie * @param bool Is the cookie permanent? */ function cookie($name, $value = '', $sticky = true) @@ -105,8 +105,8 @@ class Functions /** * Alternate between two background colours * - * @param str First CSS class name - * @param str Second CSS class name + * @param string First CSS class name + * @param string Second CSS class name */ function exec_swap_bg($class1 = 'alt1', $class2 = 'alt2') { @@ -119,9 +119,9 @@ class Functions /** * Force-download a file by sending application/octetstream * - * @param str The text of the file to be streamed - * @param str File name of the new file - * @param bool Whether or not to die after streaming the file + * @param string The text of the file to be streamed + * @param string File name of the new file + * @param bool Whether or not to die after stringeaming the file */ function download_file($file, $name, $exit = true) { @@ -152,7 +152,7 @@ class Functions /** * Verify that an email address is valid via regex * - * @param str An email address + * @param string An email address * * @return bool Validity of the email address */ @@ -171,8 +171,8 @@ class Functions /** * Check a browser's user agent against a pre-determined list * - * @param str Browser name - * @param str The browser's version + * @param string Browser name + * @param string The browser's version * * @param mixed False if there is no match, the version if there is */ @@ -320,9 +320,9 @@ class Functions /** * Generates a random string of random length (unless otherwise specified) * - * @param int Optional length + * @param integer Optional length * - * @return str A random string + * @return string A random string */ function rand($length = 0) { @@ -412,7 +412,7 @@ class Functions /** * Calculates the microtime difference by taking a given microtime and subtracting it from the current one * - * @param str The start microtime + * @param string The start microtime * * @return float Microtime difference */ @@ -427,9 +427,9 @@ class Functions /** * Fetches the extension of a file by extracting everything after the last period * - * @param str Filename + * @param string Filename * - * @return str The extension for the specifid file name + * @return string The extension for the specifid file name */ function fetch_extension($filename) { @@ -439,7 +439,7 @@ class Functions /** * Gets the maximum file size for attachment uploading, as specified by PHP. If no value is present, 10 MB (represented in bytes) is returned * - * @return int The maximum file upload size in bytes + * @return integer The maximum file upload size in bytes */ function fetch_max_attachment_size() { @@ -463,7 +463,7 @@ class Functions /** * Scans a specified directory path and returns an array of all the itmes in that directory. Directories found by this are end in a "/" * - * @param str Path to scan + * @param string Path to scan * @param bool Whether or not to recursively scan the directories encountered * @param bool Ignore files beginning with a dot * @param bool Ignore 'CVS' dirctories diff --git a/kernel.php b/kernel.php index ae1621f..2143afc 100644 --- a/kernel.php +++ b/kernel.php @@ -103,32 +103,32 @@ class Shared_Object_Framework { /** * ISSO version - * @var str + * @var string */ var $version = '[#]version[#]'; /** * Location of ISSO, used for internal linking - * @var str - * @see fetch_sourcepath(), load(), locate() + * @var string + * @see fetch_sourcepath() */ var $sourcepath = ''; /** * Path of the current application - * @var str + * @var string */ var $apppath = ''; /** * Name of the current application - * @var str + * @var string */ var $application = ''; /** * Version of the current application - * @var str + * @var string */ var $appversion = ''; @@ -148,14 +148,14 @@ class Shared_Object_Framework /** * List of loaded modules * @var array - * @see load(), show_modules() + * @see show_modules() */ var $modules = array(); /** * An array of sanitized variables that have been cleaned for HTML tag openers and double quotes * @var array - * @see sanitize(), exec_sanitize_data() + * @see sanitize() */ var $in = array(); @@ -202,9 +202,9 @@ class Shared_Object_Framework /** * Prepares a path for being set as the sourcepath * - * @param str Source path or URL + * @param string Source path or URL * - * @return str Prepared source path + * @return string Prepared source path */ function fetch_sourcepath($source) { @@ -218,7 +218,7 @@ class Shared_Object_Framework /** * Loads a framework extension * - * @param str Name of the framework + * @param string Name of the framework */ function load($framework) { @@ -237,7 +237,7 @@ class Shared_Object_Framework * the name human-readable name, and obj is the name that the module * should be initialized as; this is used in class extensions. * - * @param str Name of the framework + * @param string Name of the framework * * @return array List of initialization variables */ @@ -263,9 +263,9 @@ class Shared_Object_Framework /** * Prints a list of all currently loaded framework modules * - * @param bool Return the data as an array? + * @param bool Return the data as an array? * - * @return mixed HTML output or an array of loaded modules + * @return mixed HTML output or an array of loaded modules */ function show_modules($return = false) { @@ -285,9 +285,9 @@ class Shared_Object_Framework /** * Verifies to see if a framework has been loaded * - * @param str Framework name + * @param string Framework name * - * @return bool Whether or not the framework has been loaded + * @return bool Whether or not the framework has been loaded */ function is_loaded($framework) { @@ -304,9 +304,9 @@ class Shared_Object_Framework /** * Prints an ISSO message * - * @param str The title of the message - * @param str The content of the message - * @param int Type of message to be printed + * @param string The title of the message + * @param string The content of the message + * @param integer Type of message to be printed * @param bool Return the output? * * @return mixed Output or null @@ -354,11 +354,11 @@ class Shared_Object_Framework * Custom error handler for ISSO * We only handle E_WARNING, E_NOTICE, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE * - * @param int Error number - * @param str Error message string - * @param str File that contains the error - * @param str The line number of the error - * @param str The active symbol table at which point the error occurred + * @param integer Error number + * @param string Error message string + * @param string File that contains the error + * @param string The line number of the error + * @param string The active symbol table at which point the error occurred */ function _error_handler($errno, $errstr, $errfile, $errline) { @@ -408,7 +408,7 @@ class Shared_Object_Framework /** * Logs a debug message for verbose output * - * @param str Message + * @param string Message */ function debug($message) { @@ -448,9 +448,9 @@ class Shared_Object_Framework /** * Simple way to protect against HTML attacks with Unicode support * - * @param str Unsanitzed text + * @param string Unsanitzed text * - * @return str Properly protected text that only encodes potential threats + * @return string Properly protected text that only encodes potential threats */ function sanitize($text) { @@ -467,10 +467,10 @@ class Shared_Object_Framework /** * Takes text that has been processed for HTML and unsanitizes it * - * @param str Text that needs to be turned back into HTML + * @param string Text that needs to be turned back into HTML * @param bool Force magicquotes off * - * @return str Unsanitized text + * @return string Unsanitized text */ function unsanitize($text, $force = false) { @@ -487,11 +487,11 @@ class Shared_Object_Framework /** * Smart addslashes() that only applies itself it the Magic Quotes GPC is off * - * @param str Some string - * @param bool If the data is binary; if so it'll be run through DB::escape_string() + * @param string Some string + * @param bool If the data is binary; if so it'll be run through DB::escape_stringing() * @param bool Force magic quotes to be off * - * @return str String that has slashes added + * @return string String that has slashes added */ function escape($str, $binary = false, $force = true) { @@ -540,25 +540,6 @@ class Shared_Object_Framework */ $_isso = new Shared_Object_Framework(); -/** -* Wrapper for ternary operator that has to be in the global scope. -* This function is going to be removed from our applications due -* to it's latency in processing. This will remain here purely -* for legacy reasons. It will be removed when necessary. -* -* @deprecated The normal ternary operators should be used instead; function calls are too expensive -* -* @param expr Expression -* @param mixed If the expression is true -* @param mixed If the expression is false -* -* @return mixed True or false data -*/ -function iff($condition, $iftrue, $iffalse = null) -{ - return ($condition) ? ($iftrue) : ($iffalse); -} - if (defined('ISSO_CHECK_POST_REFERER')) { if ($_SERVER['REQUEST_METHOD'] == 'POST') diff --git a/localize.php b/localize.php index 3e6188f..8ecda2c 100644 --- a/localize.php +++ b/localize.php @@ -74,9 +74,9 @@ class Localize /** * Returns a localized string from the table * - * @param str Text to localize + * @param string Text to localize * - * @return str Localized string + * @return string Localized string */ function string($key) { @@ -96,9 +96,9 @@ class Localize /** * Returns a value from the lex table for a specific code * - * @param str Lex code + * @param string Lex code * - * @return str Localized string + * @return string Localized string */ function getlex($code) { @@ -119,8 +119,8 @@ class Localize * Sets a value in the lex table for easy access of strings * that are commonly used * - * @param str Lex code - * @param str Text equiv + * @param string Lex code + * @param string Text equiv */ function setlex($code, $value) { diff --git a/mail.php b/mail.php index dcb8bc7..46896e4 100644 --- a/mail.php +++ b/mail.php @@ -46,42 +46,42 @@ class Mail { /** * The message recipient's email address - * @var str + * @var string * @see send() */ var $to = ''; /** * The subject of the message - * @var str + * @var string * @see send() */ var $subject = ''; /** * Body of the message - * @var str + * @var string * @see send() */ var $body = ''; /** * The message sender's email address - * @var str + * @var string * @see send() */ var $from = ''; /** * The message sender's display name - * @var str + * @var string * @see send() */ var $fromname = ''; /** * Additional message headers - * @var str + * @var string */ var $headers = ''; @@ -176,9 +176,9 @@ class Mail /** * Fetches the first line of a string * - * @param str A string + * @param string A string * - * @return str The first line of the string + * @return string The first line of the string */ function _fetch_first_line($string) { @@ -190,10 +190,10 @@ class Mail /** * Changes line breaks into one format * - * @param str Text - * @param str New line break (default is UNIX format) + * @param string Text + * @param string New line break (default is UNIX format) * - * @return str Text with one type of line break + * @return string Text with one type of line break */ function _convert_line_breaks($text, $convert_to = "\n") { diff --git a/template.php b/template.php index 64f7ba6..c4266a4 100644 --- a/template.php +++ b/template.php @@ -46,42 +46,42 @@ class DB_Template { /** * Name of the database table templates are in - * @var str + * @var string * @see _load() */ var $templatetable = ''; /** * Name of the table column template names are in - * @var str + * @var string * @see $templatetable, _load() */ var $namecolumn = ''; /** * Name of the table column templates are in - * @var str + * @var string * @see templatetable, _load() */ var $datacolumn = ''; /** * Additional WHERE clauses for the template fetch SQL - * @var str + * @var string * @see _load(), cache() */ var $extrawhere = ''; /** * The name of the function phrases are fetched with - * @var str + * @var string * @see _parse_phrases() */ var $langcall = '$GLOBALS[\'_isso\']->lang->string'; /** * The name of the function phrases are sprintf() parsed with - * @var str + * @var string * @see _parse_phrases() */ var $langconst = 'sprintf'; @@ -118,7 +118,7 @@ class DB_Template * Takes an array of template names, loads them, and then stores * a parsed version for optimum speed. * - * @param array List of template names to be cached + * @param array List of template names to be cached */ function cache($namearray) { @@ -144,9 +144,9 @@ class DB_Template * Loads a template from the cache or the _load function and * stores the parsed version of it * - * @param str The name of the template + * @param string The name of the template * - * @return str A parsed and loaded template + * @return string A parsed and loaded template */ function fetch($name) { @@ -177,7 +177,7 @@ class DB_Template /** * Output a template fully compiled to the browser * - * @param str Compiled and ready template + * @param string Compiled and ready template */ function flush($template) { @@ -351,9 +351,9 @@ class DB_Template /** * Loads an additional template from the database * - * @param str The name of the template + * @param string The name of the template * - * @return str Template data from the database + * @return string Template data from the database */ function _load($name) { @@ -372,9 +372,9 @@ class DB_Template /** * A wrapper for all the parsing functions and compiling functins * - * @param str Unparsed template data + * @param string Unparsed template data * - * @return str Parsed template data + * @return string Parsed template data */ function _parse($template) { @@ -388,9 +388,9 @@ class DB_Template /** * Prepares language and locale information inside templates * - * @param str Template data to be processed + * @param string Template data to be processed * - * @return str Language-ready template data + * @return string Language-ready template data */ function _parse_phrases($template) { @@ -466,9 +466,9 @@ class DB_Template /** * Parser for in-line template conditionals * - * @param str Template data awaiting processing + * @param string Template data awaiting processing * - * @return str Parsed template data + * @return string Parsed template data */ function _parse_conditionals($template) { diff --git a/template_fs.php b/template_fs.php index 13f0cd1..da34848 100644 --- a/template_fs.php +++ b/template_fs.php @@ -51,14 +51,14 @@ class FS_Template extends DB_Template { /** * The path, from the path of the application, where templates are stored - * @var str + * @var string * @see Shared_Object_Framework::$apppath, _load() */ var $templatedir = ''; /** * The extension all the template files have - * @var str + * @var string * @see _load() */ var $extension = 'tpl'; @@ -67,7 +67,7 @@ class FS_Template extends DB_Template * Takes an array of template names, loads them, and then stores * a parsed version for optimum speed. * - * @param array List of template names to be cached + * @param array List of template names to be cached */ function cache($namearray) { @@ -91,7 +91,7 @@ class FS_Template extends DB_Template * Loads a template from the file system from the specified $templatedir * with the file extension $extension * - * @param str The name of the template call + * @param string The name of the template call */ function _load($name) { diff --git a/xml.php b/xml.php index d120d73..338ef0f 100644 --- a/xml.php +++ b/xml.php @@ -45,7 +45,7 @@ class XML_Parser { /** * Parser resource - * @var res + * @var integer * @see parse() */ var $parser = null; @@ -84,7 +84,7 @@ class XML_Parser /** * Parse an XML file * - * @param str XML file data + * @param string XML file data * * @return array Array with all the XML data parsed */ @@ -125,8 +125,8 @@ class XML_Parser /** * Process the opening location of an XML tag * - * @param res XML parser - * @param str Tag name + * @param integer XML parser + * @param string Tag name * @param array Tag attributes */ function handle_tag_start(&$parser, $name, $attrs) @@ -158,8 +158,8 @@ class XML_Parser /** * Process XML CDATA * - * @param res XML parser - * @param str CDATA from tag + * @param integer XML parser + * @param string CDATA from tag */ function handle_cdata(&$parser, $data) { @@ -169,8 +169,8 @@ class XML_Parser /** * Process the closing of an XML tag * - * @param res XML parser - * @param str Tag name + * @param integer XML parser + * @param string Tag name */ function handle_tag_end(&$parser, $name) { -- 2.22.5