Fix up warnings/errors in phpdoc tags
Fix up warnings/errors in phpdoc tags

--- a/include/Resource.class.php
+++ b/include/Resource.class.php
@@ -12,6 +12,9 @@
 require_once(GITPHP_BASEDIR . 'lib/php-gettext/streams.php');
 require_once(GITPHP_BASEDIR . 'lib/php-gettext/gettext.php');
 
+/**
+ * Constant of the locale cookie in the user's browser
+ */
 define('GITPHP_LOCALE_COOKIE', 'GitPHPLocale');
 
 /**
@@ -244,7 +247,10 @@
 
 
 /**
- * Wrappers... because PHP doesn't support aliases
+ * Gettext wrapper function for readability, single string
+ *
+ * @param string $str string to translate
+ * @return string translated string
  */
 function __($str)
 {
@@ -253,6 +259,14 @@
 	return $str;
 }
 
+/**
+ * Gettext wrapper function for readability, plural form
+ *
+ * @param string $singular singular form of string
+ * @param string $plural plural form of string
+ * @param int $count number of items
+ * @return string translated string
+ */
 function __n($singular, $plural, $count)
 {
 	if (GitPHP_Resource::Instantiated())

--- a/include/cache/Cache.class.php
+++ b/include/cache/Cache.class.php
@@ -22,8 +22,6 @@
 	 * Template
 	 *
 	 * Cache template
-	 *
-	 * @const
 	 */
 	const Template = 'data.tpl';
 

--- a/include/cache/memcache_cache_handler.php
+++ b/include/cache/memcache_cache_handler.php
@@ -11,6 +11,9 @@
  * @subpackage Cache
  */
 
+/**
+ * Cache key for the cache contents / age map array
+ */
 define('MEMCACHE_OBJECT_MAP', 'memcache_objectmap');
 
 function memcache_cache_handler($action, &$smarty_obj, &$cache_content, $tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)

--- a/include/controller/ControllerBase.class.php
+++ b/include/controller/ControllerBase.class.php
@@ -187,7 +187,7 @@
 	 * Read query into parameters
 	 *
 	 * @abstract
-	 * @access prtected
+	 * @access protected
 	 */
 	protected abstract function ReadQuery();
 

--- a/include/controller/Controller_Feed.class.php
+++ b/include/controller/Controller_Feed.class.php
@@ -11,8 +11,14 @@
  * @subpackage Controller
  */
 
+/**
+ * Constant for the number of items to load into the feed
+ */
 define('GITPHP_FEED_ITEMS', 150);
 
+/**
+ * Constants for the different feed formats
+ */
 define('GITPHP_FEED_FORMAT_RSS', 'rss');
 define('GITPHP_FEED_FORMAT_ATOM', 'atom');
 

--- a/include/controller/Controller_Search.class.php
+++ b/include/controller/Controller_Search.class.php
@@ -10,6 +10,9 @@
  * @subpackage Controller
  */
 
+/**
+ * Constants for the various search types
+ */
 define('GITPHP_SEARCH_COMMIT', 'commit');
 define('GITPHP_SEARCH_AUTHOR', 'author');
 define('GITPHP_SEARCH_COMMITTER', 'committer');

--- a/include/git/GitExe.class.php
+++ b/include/git/GitExe.class.php
@@ -10,6 +10,9 @@
  * @subpackage Git
  */
 
+/**
+ * Constants for git commands
+ */
 define('GIT_CAT_FILE','cat-file');
 define('GIT_DIFF_TREE','diff-tree');
 define('GIT_LS_TREE','ls-tree');

--- a/include/git/Tree.class.php
+++ b/include/git/Tree.class.php
@@ -7,7 +7,7 @@
  * @author Christopher Han <xiphux@gmail.com>
  * @copyright Copyright (c) 2010 Christopher Han
  * @package GitPHP
- * @subpackge Git
+ * @subpackage Git
  */
 
 require_once(GITPHP_GITOBJECTDIR . 'FilesystemObject.class.php');

--- a/include/smartyplugins/function.scripturl.php
+++ b/include/smartyplugins/function.scripturl.php
@@ -1,12 +1,22 @@
 <?php
-/*
- *  function.scripturl.php
- *  gitphp: A PHP git repository browser
- *  Component: Utility - get running script url
+/**
+ * scripturl
  *
- *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ * Smarty function to get the full url of the current script
+ *
+ * @author Christopher Han <xiphux@gmail.com>
+ * @copyright Copyright (c) 2010 Christopher Han
+ * @package GitPHP
+ * @subpackage Smarty
  */
 
+/**
+ * scripturl smarty function
+ *
+ * @param array $params function parameters
+ * @param mixed $smarty smarty object
+ * @return string script url
+ */
 function smarty_function_scripturl($params, &$smarty)
 {
 	if (GitPHP_Config::GetInstance()->HasKey('self')) {

--- a/include/smartyplugins/modifier.agestring.php
+++ b/include/smartyplugins/modifier.agestring.php
@@ -1,12 +1,22 @@
 <?php
-/*
- *  modifier.agestring.php
- *  gitphp: A PHP git repository browser
- *  Component: Utility - convert age to a readable string
+/**
+ * agestring
  *
- *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
+ * Smarty modifier to turn an age in seconds into a
+ * human-readable string
+ *
+ * @author Christopher Han <xiphux@gmail.com>
+ * @copyright Copyright (c) 2010 Christopher Han
+ * @package GitPHP
+ * @subpackage Smarty
  */
 
+/**
+ * agestring smarty modifier
+ *
+ * @param int $age age in seconds
+ * @return string human readable string
+ */
 function smarty_modifier_agestring($age)
 {
 	if ($age > 60*60*24*365*2) {

--- a/include/smartyplugins/modifier.buglink.php
+++ b/include/smartyplugins/modifier.buglink.php
@@ -7,8 +7,17 @@
  * @author Christopher Han <xiphux@gmail.com>
  * @copyright Copyright (c) 2010 Christopher Han
  * @package GitPHP
+ * @subpackage Smarty
  */
 
+/**
+ * buglink smarty modifier
+ *
+ * @param string $text text to find bug references in
+ * @param string $pattern search pattern
+ * @param string $link link pattern
+ * @return string text with bug references linked
+ */
 function smarty_modifier_buglink($text, $pattern = null, $link = null)
 {
 	if (empty($text) || empty($pattern) || empty($link))

--- a/include/smartyplugins/modifier.highlight.php
+++ b/include/smartyplugins/modifier.highlight.php
@@ -1,12 +1,25 @@
 <?php
-/*
- *  modifier.highlight.php
- *  gitphp: A PHP git repository browser
- *  Component: Utility - highlight a string
+/**
+ * highlight
  *
- *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
+ * Smarty modifier to highlight a substring
+ *
+ * @author Christopher Han <xiphux@gmail.com>
+ * @copyright Copyright (c) 2010 Christopher Han
+ * @package GitPHP
+ * @subpackage Smarty
  */
 
+/**
+ * highlight smarty modifier
+ *
+ * @param string $haystack string to search in
+ * @param string $needle substring to search for
+ * @param int $trimlen length to trim string to
+ * @param bool $escape true to html escape the string
+ * @param string $highlightclass CSS class to highlight with
+ * @return string highlighted string
+ */
 function smarty_modifier_highlight($haystack, $needle, $trimlen = NULL, $escape = false, $highlightclass = 'searchmatch')
 {
 	if (preg_match("/(.*)(" . quotemeta($needle) . ")(.*)/i",$haystack,$regs)) {

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -9,6 +9,9 @@
  * @package GitPHP
  */
 
+/**
+ * Define start time / memory for benchmarking
+ */
 define('GITPHP_START_TIME', microtime(true));
 define('GITPHP_START_MEM', memory_get_usage());
 

comments