]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Lots of new @todos :(
authorSteve Clay <steve@mrclay.org>
Tue, 5 Feb 2013 02:09:02 +0000 (21:09 -0500)
committercash <cash.costello@gmail.com>
Sat, 9 Feb 2013 15:30:34 +0000 (10:30 -0500)
14 files changed:
engine/classes/ElggDiskFilestore.php
engine/classes/ElggFile.php
engine/classes/ElggGroup.php
engine/classes/ElggMenuBuilder.php
engine/classes/ElggPlugin.php
engine/lib/annotations.php
engine/lib/calendar.php
engine/lib/database.php
engine/lib/entities.php
engine/lib/input.php
engine/lib/metastrings.php
engine/lib/notification.php
engine/lib/plugins.php
engine/lib/system_log.php

index 2d86e7c2dcc5d4eec254831e922d97c7a69e3866..7374aad3566389f4897137553973a90588cd5c83 100644 (file)
@@ -60,6 +60,7 @@ class ElggDiskFilestore extends ElggFilestore {
 
                $path = substr($fullname, 0, $ls);
                $name = substr($fullname, $ls);
+               // @todo $name is unused, remove it or do we need to fix something?
 
                // Try and create the directory
                try {
index 532db36179595a4540f78575a6207358e1608919..3e9c24c1767a08fee75fa3af68e910d9d6093c89 100644 (file)
@@ -93,6 +93,7 @@ class ElggFile extends ElggObject {
                        $container_guid = $this->container_guid;
                }
                $fs = $this->getFilestore();
+               // @todo add getSize() to ElggFilestore
                return $fs->getSize($prefix, $container_guid);
        }
 
@@ -289,6 +290,7 @@ class ElggFile extends ElggObject {
        public function seek($position) {
                $fs = $this->getFilestore();
 
+               // @todo add seek() to ElggFilestore
                return $fs->seek($this->handle, $position);
        }
 
@@ -393,6 +395,7 @@ class ElggFile extends ElggObject {
 
                        $this->filestore = new $filestore();
                        $this->filestore->setParameters($parameters);
+                       // @todo explain why $parameters will always be set here (PhpStorm complains)
                }
 
                // this means the entity hasn't been saved so fallback to default
index 24bdee79ea0035aad32f402ed82b000dd9bf05ad..61f699f1aec5f7e827dd7eb103f7f21956ffdedd 100644 (file)
@@ -220,6 +220,7 @@ class ElggGroup extends ElggEntity
         * @return array|false
         */
        public function getObjects($subtype = "", $limit = 10, $offset = 0) {
+               // @todo are we deprecating this method, too?
                return get_objects_in_group($this->getGUID(), $subtype, 0, 0, "", $limit, $offset, false);
        }
 
@@ -233,6 +234,7 @@ class ElggGroup extends ElggEntity
         * @return array|false
         */
        public function getFriendsObjects($subtype = "", $limit = 10, $offset = 0) {
+               // @todo are we deprecating this method, too?
                return get_objects_in_group($this->getGUID(), $subtype, 0, 0, "", $limit, $offset, false);
        }
 
@@ -244,6 +246,7 @@ class ElggGroup extends ElggEntity
         * @return array|false
         */
        public function countObjects($subtype = "") {
+               // @todo are we deprecating this method, too?
                return get_objects_in_group($this->getGUID(), $subtype, 0, 0, "", 10, 0, true);
        }
 
index 6da95159764c0f9dcae6e560993e2c9f334159e6..0dce02be497c453ed7ebbe918be627200b77d0b8 100644 (file)
@@ -274,6 +274,8 @@ class ElggMenuBuilder {
         * @param ElggMenuItem $a
         * @param ElggMenuItem $b
         * @return bool
+        *
+        * @todo deprecate this? weight seems to be deprecated
         */
        public static function compareByWeight($a, $b) {
                $aw = $a->getWeight();
index 066fd9a79451e06d1a030aa60aa1756ec803b825..ae447bddb82872750a14136fd539cf9de2b26db6 100644 (file)
@@ -597,6 +597,8 @@ class ElggPlugin extends ElggObject {
         * Checks if this plugin can be activated on the current
         * Elgg installation.
         *
+        * @todo remove $site_guid param or implement it
+        *
         * @param mixed $site_guid Optional site guid
         * @return bool
         */
index 41a736aa11883d4463f0a39bdc39f1a2c0a7489d..f40a2cc6fc41baa033bcf405cf52eccf68e6eabd 100644 (file)
@@ -17,6 +17,7 @@
  */
 function row_to_elggannotation($row) {
        if (!($row instanceof stdClass)) {
+               // @todo should throw in this case?
                return $row;
        }
 
index 9a06c52921c74989f16f25e78c5f39274838cd64..e6f95934c0e578f1c65e64a357b64022732a2470 100644 (file)
@@ -39,6 +39,8 @@ function get_day_end($day = null, $month = null, $year = null) {
 /**
  * Return the notable entities for a given time period.
  *
+ * @todo this function also accepts an array(type => subtypes) for 3rd arg. Should we document this?
+ *
  * @param int     $start_time     The start time as a unix timestamp.
  * @param int     $end_time       The end time as a unix timestamp.
  * @param string  $type           The type of entity (eg "user", "object" etc)
index dcf50545d674ffc98cab4cad29a9036c8d2ff052..2b348366d766f8a941d34e933deb6574d4c87656 100644 (file)
@@ -123,6 +123,8 @@ function establish_db_link($dblinkname = "readwrite") {
 
        // Set up cache if global not initialized and query cache not turned off
        if ((!$DB_QUERY_CACHE) && (!$db_cache_off)) {
+               // @todo everywhere else this is assigned to array(), making it dangerous to call
+               // object methods on this. We should consider making this an plain array
                $DB_QUERY_CACHE = new ElggStaticVariableCache('db_query_cache');
        }
 }
index e3535c7417df5d1f3033fbf23c4a3ebdacb91f5a..25c927ac6b1865bf39f8d8bd75c142a9728c99fa 100644 (file)
@@ -1220,6 +1220,7 @@ function elgg_get_entity_type_subtype_where_sql($table, $types, $subtypes, $pair
                        if ($subtypes) {
                                foreach ($subtypes as $subtype) {
                                        // check that the subtype is valid (with ELGG_ENTITIES_NO_VALUE being a valid subtype)
+                                       // @todo simplify this logic
                                        if (ELGG_ENTITIES_NO_VALUE === $subtype || $subtype_id = get_subtype_id($type, $subtype)) {
                                                $subtype_ids[] = (ELGG_ENTITIES_NO_VALUE === $subtype) ? ELGG_ENTITIES_NO_VALUE : $subtype_id;
                                        } else {
@@ -1461,6 +1462,8 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
  *
  * @tip Use this to generate a list of archives by month for when entities were added or updated.
  *
+ * @todo document how to pass in array for $subtype
+ *
  * @warning Months are returned in the form YYYYMM.
  *
  * @param string $type           The type of entity
index bbb9ff94d7eca3e66a8e49cf9f7d8db162d54854..2d9bae4dd80276bdc826cb312f64a49982802227 100644 (file)
@@ -226,6 +226,8 @@ function elgg_clear_sticky_value($form_name, $variable) {
 /**
  * Page handler for autocomplete endpoint.
  *
+ * @todo split this into functions/objects, this is way too big
+ *
  * /livesearch?q=<query>
  *
  * Other options include:
@@ -288,6 +290,7 @@ function input_livesearch_page_handler($page) {
 
                                if ($entities = get_data($query)) {
                                        foreach ($entities as $entity) {
+                                               // @todo use elgg_get_entities (don't query in a loop!)
                                                $entity = get_entity($entity->guid);
                                                /* @var ElggUser $entity */
                                                if (!$entity) {
@@ -338,6 +341,7 @@ function input_livesearch_page_handler($page) {
                                ";
                                if ($entities = get_data($query)) {
                                        foreach ($entities as $entity) {
+                                               // @todo use elgg_get_entities (don't query in a loop!)
                                                $entity = get_entity($entity->guid);
                                                /* @var ElggGroup $entity */
                                                if (!$entity) {
@@ -386,6 +390,7 @@ function input_livesearch_page_handler($page) {
 
                                if ($entities = get_data($query)) {
                                        foreach ($entities as $entity) {
+                                               // @todo use elgg_get_entities (don't query in a loop!)
                                                $entity = get_entity($entity->guid);
                                                /* @var ElggUser $entity */
                                                if (!$entity) {
index 7e18597a65882e4b8c72431bc62deb2dbb734c05..76c4bd8c439f9795a0f9dea68ffde20ea0a50465 100644 (file)
@@ -804,6 +804,7 @@ function elgg_delete_metastring_based_object_by_id($id, $type) {
                        }
 
                        if ($metabyname_memcache) {
+                               // @todo why name_id? is that even populated?
                                $metabyname_memcache->delete("{$obj->entity_guid}:{$obj->name_id}");
                        }
                }
index f0aff84e6ab732b06e6a82379e1b5eedf92bc0e5..56e5911927958089de541aa73be86a8272ed06fc 100644 (file)
@@ -174,7 +174,8 @@ function get_user_notification_settings($user_guid = 0) {
                $user_guid = elgg_get_logged_in_user_guid();
        }
 
-       // @todo: holy crap, really?
+       // @todo: there should be a better way now that metadata is cached. E.g. just query for MD names, then
+       // query user object directly
        $all_metadata = elgg_get_metadata(array(
                'guid' => $user_guid,
                'limit' => 0
index 0ea4404f37cd910a60ec3e83ed731f0c88de2566..f281b141607147812094a1e2a1bc81b518434a43 100644 (file)
@@ -91,7 +91,9 @@ function elgg_get_plugin_ids_in_dir($dir = null) {
  * @access private
  */
 function elgg_generate_plugin_entities() {
+       // @todo $site unused, can remove?
        $site = get_config('site');
+
        $dir = elgg_get_plugins_path();
        $db_prefix = elgg_get_config('dbprefix');
 
index 38bc4ba961dab98ed3602cf503e9c7bdfb75c391..5a153afb2031e55ddfbac37c508e66b0929fcba5 100644 (file)
@@ -10,6 +10,8 @@
 /**
  * Retrieve the system log based on a number of parameters.
  *
+ * @todo too many args, and the first arg is too confusing
+ *
  * @param int|array $by_user    The guid(s) of the user(s) who initiated the event.
  *                              Use 0 for unowned entries. Anything else falsey means anyone.
  * @param string    $event      The event you are searching on.