]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
coding standards fixes - comments
authorCash Costello <cash.costello@gmail.com>
Sun, 8 Jan 2012 22:48:29 +0000 (17:48 -0500)
committerCash Costello <cash.costello@gmail.com>
Sun, 8 Jan 2012 22:48:29 +0000 (17:48 -0500)
13 files changed:
engine/classes/ElggCache.php
engine/classes/ElggMenuBuilder.php
engine/classes/ElggMenuItem.php
engine/classes/ElggPlugin.php
engine/classes/ElggPluginPackage.php
engine/classes/ElggSite.php
engine/lib/access.php
engine/lib/admin.php
engine/lib/database.php
engine/lib/extender.php
engine/lib/input.php
engine/lib/relationships.php
engine/lib/river.php

index dd53525b8b2091e7753265d78dc38b0561d38062..4317f4be9ec650b1ba3701f1f2063dc1acb30537 100644 (file)
@@ -191,8 +191,8 @@ abstract class ElggCache implements ArrayAccess {
         *
         * @see ArrayAccess::offsetSet()
         *
-        * @param mixed $key    The key (offset) to assign the value to.
-        * @param mixed $value  The value to set.
+        * @param mixed $key   The key (offset) to assign the value to.
+        * @param mixed $value The value to set.
         *
         * @return void
         */
@@ -205,7 +205,7 @@ abstract class ElggCache implements ArrayAccess {
         *
         * @see ArrayAccess::offsetGet()
         *
-        * @param mixed $offset The key (offset) to retrieve.
+        * @param mixed $key The key (offset) to retrieve.
         *
         * @return mixed
         */
index cadfee7f5aa8336273e9269aa5c1401414f8c218..6f4ac702ebcb5fed8d3e13cc039881f4e6ad0820 100644 (file)
@@ -16,16 +16,16 @@ class ElggMenuBuilder {
        /**
         * ElggMenuBuilder constructor
         *
-        * @param string $name  Identifier of the menu
+        * @param array $menu Array of ElggMenuItem objects
         */
-       public function __construct($menu) {
+       public function __construct(array $menu) {
                $this->menu = $menu;
        }
 
        /**
         * Get a prepared menu array
         *
-        * @param mixed $sort_by
+        * @param mixed $sort_by Method to sort the menu by. @see ElggMenuBuilder::sort()
         * @return array
         */
        public function getMenu($sort_by = 'text') {
@@ -80,6 +80,7 @@ class ElggMenuBuilder {
 
        /**
         * Group the menu items into sections
+        * 
         * @return void
         */
        protected function setupSections() {
index 62547134adc73b615d5b2733e78b38dd68aa0c24..2512392ad77f25f5bcb73d06b9d8be0893fff360 100644 (file)
@@ -2,12 +2,12 @@
 /**
  * Elgg Menu Item
  *
- * @package    Elgg.Core
- * @subpackage Navigation
- *
  * To create a menu item that is not a link, pass false for $href.
  *
  * @since 1.8.0
+ *
+ * @package    Elgg.Core
+ * @subpackage Navigation
  */
 class ElggMenuItem {
 
@@ -70,9 +70,9 @@ class ElggMenuItem {
        /**
         * ElggMenuItem constructor
         *
-        * @param string $name  Identifier of the menu item
-        * @param string $text  Display text of the menu item
-        * @param string $href  URL of the menu item (false if not a link)
+        * @param string $name Identifier of the menu item
+        * @param string $text Display text of the menu item
+        * @param string $href URL of the menu item (false if not a link)
         */
        public function __construct($name, $text, $href) {
                //$this->name = $name;
@@ -182,7 +182,7 @@ class ElggMenuItem {
        /**
         * Set the identifier of the menu item
         *
-        * @param string Unique identifier
+        * @param string $name Unique identifier
         * @return void
         */
        public function setName($name) {
@@ -491,7 +491,7 @@ class ElggMenuItem {
        /**
         * Set the parent menu item
         *
-        * @param ElggMenuItem $parent
+        * @param ElggMenuItem $parent The parent of this menu item
         * @return void
         */
        public function setParent($parent) {
@@ -510,7 +510,7 @@ class ElggMenuItem {
        /**
         * Add a child menu item
         *
-        * @param ElggMenuItem $item
+        * @param ElggMenuItem $item A child menu item
         * @return void
         */
        public function addChild($item) {
@@ -549,10 +549,10 @@ class ElggMenuItem {
        /**
         * Get the menu item content (usually a link)
         *
+        * @todo View code in a model.  How do we feel about that?
+        *
         * @params array $vars Options to pass to output/url if a link
         * @return string
-        *
-        * @todo View code in a model.  How do we feel about that?
         */
        public function getContent(array $vars = array()) {
 
index c4d6ec0340b55c09d6eae50f839bd87afd4cf925..33f14ae37b1e2316d3c2f3a8ac249b660b6c5c02 100644 (file)
@@ -707,9 +707,9 @@ class ElggPlugin extends ElggObject {
         * @throws PluginException
         */
        public function start($flags) {
-//             if (!$this->canActivate()) {
-//                     return false;
-//             }
+               //if (!$this->canActivate()) {
+               //      return false;
+               //}
 
                // include classes
                if ($flags & ELGG_PLUGIN_REGISTER_CLASSES) {
index d240af4776f1c3ddd7293e5d6c1a9ceb1a124e79..2dc4bdb3de7163fccf9a6a776519d1dd65859d91 100644 (file)
@@ -303,6 +303,8 @@ class ElggPluginPackage {
 
        /**
         * Returns an array of present and readable text files
+        *
+        * @return array
         */
        public function getTextFilenames() {
                return $this->textFiles;
index 7ea52a195a66486e09510707c0215f31ff7e95d2..b13683a561ae6354a480935a094f7b491ddb9511 100644 (file)
@@ -196,7 +196,7 @@ class ElggSite extends ElggEntity {
         *
         * @note You cannot disable the current site.
         *
-        * @param string $reason Optional reason for disabling
+        * @param string $reason    Optional reason for disabling
         * @param bool   $recursive Recursively disable all contained entities?
         *
         * @return bool
@@ -219,7 +219,7 @@ class ElggSite extends ElggEntity {
         *                       accepted by elgg_get_entities(). Common parameters
         *                       include 'limit', and 'offset'.
         *                       Note: this was $limit before version 1.8
-        * @param int $offset Offset @deprecated parameter
+        * @param int   $offset  Offset @deprecated parameter
         *
         * @todo remove $offset in 2.0
         *
index 7be92fbfc449b0cc42f88560e7fa8b7ee80346f9..dba1e1ec6bbd0cc4bf73a090bec8603d822e301d 100644 (file)
@@ -984,9 +984,9 @@ function elgg_override_permissions($hook, $type, $value, $params) {
        }
 
        // don't do this so ignore access still works with no one logged in
-//     if (!$user instanceof ElggUser) {
-//             return false;
-//     }
+       //if (!$user instanceof ElggUser) {
+       //      return false;
+       //}
 
        // check for admin
        if ($user_guid && elgg_is_admin_user($user_guid)) {
index 1f085eee4c8db33cc3f2e2ab67806ac925ff2366..a573e79d6c3e04509b14ed74f14bd9a83cf9d8a1 100644 (file)
@@ -179,10 +179,10 @@ function elgg_admin_notice_exists($id) {
  *
  * This function handles registering the parent if it has not been registered.
  *
- * @param string $section    The menu section to add to
- * @param string $menu_id    The unique ID of section
- * @param string $parent_id  If a child section, the parent section id
- * @param int    $priority   The menu item priority
+ * @param string $section   The menu section to add to
+ * @param string $menu_id   The unique ID of section
+ * @param string $parent_id If a child section, the parent section id
+ * @param int    $priority  The menu item priority
  *
  * @return bool
  * @since 1.8.0
index c44fdf1fd80e1618ad77440f58ae062e65f98ea4..444bb7cc4b3e535ec7df04406cc4440b3ec8be81 100644 (file)
@@ -728,9 +728,9 @@ function sanitize_string($string) {
 /**
  * Sanitises an integer for database use.
  *
- * @param int $int Integer
- * @param bool[optional] $signed Whether negative values should be allowed (true)
- * @return int Sanitised integer
+ * @param int  $int    Value to be sanitized
+ * @param bool $signed Whether negative values should be allowed (true)
+ * @return int
  */
 function sanitise_int($int, $signed = true) {
        $int = (int) $int;
@@ -745,12 +745,12 @@ function sanitise_int($int, $signed = true) {
 }
 
 /**
- * Sanitises an integer for database use.
+ * Sanitizes an integer for database use.
  * Wrapper function for alternate English spelling (@see sanitise_int)
  *
- * @param int $int Integer
- * @param bool[optional] $signed Whether negative values should be allowed (true)
- * @return int Sanitised integer
+ * @param int  $int    Value to be sanitized
+ * @param bool $signed Whether negative values should be allowed (true)
+ * @return int
  */
 function sanitize_int($int, $signed = true) {
        return sanitise_int($int, $signed);
index 51fc62c30e4ea91d736aa94f3e106527eb8cf49d..ffd3c1357559d2cc3a53baa63410010ac9899160 100644 (file)
@@ -164,9 +164,9 @@ function can_edit_extender($extender_id, $type, $user_guid = 0) {
  * It is recommended that you do not call this directly, instead use
  * one of the wrapper functions such as elgg_register_annotation_url_handler().
  *
- * @param string $function_name The function to register
  * @param string $extender_type Extender type ('annotation', 'metadata')
  * @param string $extender_name The name of the extender
+ * @param string $function_name The function to register
  *
  * @return bool
  */
index 57e35786f9647c257d42fda6202a228f5eb27461..dda8211b6c3a6f9e9a2ba51c09f5b0ff73736f44 100644 (file)
@@ -188,8 +188,8 @@ function elgg_get_sticky_value($form_name, $variable = '', $default = NULL, $fil
 /**
  * Get all the values in a sticky form in an array
  *
- * @param string $form_name    The name of the form
- * @param bool $filter_result  Filter for bad input if true
+ * @param string $form_name     The name of the form
+ * @param bool   $filter_result Filter for bad input if true
  *
  * @return array
  * @since 1.8.0
index 5b7080b563ce97a1a8d1dc524b5b9a1270c19c32..fabe2d2d603e6d7f077332ca77969da6f5c828a5 100644 (file)
@@ -399,8 +399,8 @@ function elgg_list_entities_from_relationship_count($options) {
 /**
  * Sets the URL handler for a particular relationship type
  *
- * @param string $function_name     The function to register
  * @param string $relationship_type The relationship type.
+ * @param string $function_name     The function to register
  *
  * @return bool Depending on success
  */
index 63625878f4c08859d2649c0556d179cc49d0bcdd..547d9495e4227953f9fa22355dc7bd1c5fb630eb 100644 (file)
@@ -108,7 +108,7 @@ $posted = 0, $annotation_id = 0) {
  *
  * @warning not checking access (should we?)
  *
- * @param array $options
+ * @param array $options Parameters:
  *   ids                  => INT|ARR River item id(s)
  *   subject_guids        => INT|ARR Subject guid(s)
  *   object_guids         => INT|ARR Object guid(s)
@@ -215,7 +215,7 @@ function elgg_delete_river(array $options = array()) {
  *
  * @note If using types and subtypes in a query, they are joined with an AND.
  *
- * @param array $options
+ * @param array $options Parameters:
  *   ids                  => INT|ARR River item id(s)
  *   subject_guids        => INT|ARR Subject guid(s)
  *   object_guids         => INT|ARR Object guid(s)
@@ -548,7 +548,7 @@ function elgg_river_get_action_where_sql($types) {
 /**
  * Get the where clause based on river view strings
  *
- * @param array $types Array of view strings
+ * @param array $views Array of view strings
  *
  * @return string
  * @since 1.8.0