]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
More PHPDoc comments and @var declarations to help IDE comprehension
authorSteve Clay <steve@mrclay.org>
Mon, 9 Apr 2012 19:06:33 +0000 (15:06 -0400)
committerSteve Clay <steve@mrclay.org>
Mon, 9 Apr 2012 19:06:33 +0000 (15:06 -0400)
lib/videolist.php
start.php
upgrades/2012022501.php
views/default/icon/object/videolist_item.php
views/default/object/videolist_item.php

index 2dfc7d8fc4bba0f0866a6d823539ed28c2905634..96a2c6335026919cf211993e0e2627e0e438c092 100644 (file)
@@ -6,6 +6,10 @@ foreach(explode(', ', VIDEOLIST_SUPPORTED_PLATFORMS) as $videotype){
        include(elgg_get_plugins_path()."videolist/lib/$videotype.php");
 }
 
+/**
+ * @param string $url
+ * @return array
+ */
 function videolist_parseurl($url){
        foreach(explode(', ', VIDEOLIST_SUPPORTED_PLATFORMS) as $videotype){
                if (is_callable("videolist_parseurl_$videotype")){
@@ -17,6 +21,10 @@ function videolist_parseurl($url){
        return array();
 }
 
+/**
+ * @param array $parsed
+ * @return array
+ */
 function videolist_get_data($parsed) {
        $videotype = $parsed['videotype'];
        $video_id = $parsed['video_id'];
index 07ec618a0a652305caa41dea365a72ca5b34a2cd..d764a78c9f826faf76b4c9db3250ab945604c10a 100644 (file)
--- a/start.php
+++ b/start.php
@@ -128,6 +128,12 @@ function videolist_page_handler($page) {
 
 /**
  * Add a menu item to the user ownerblock
+ *
+ * @param string $hook
+ * @param string $type
+ * @param array $return
+ * @param array $params
+ * @return array
  */
 function videolist_owner_block_menu($hook, $type, $return, $params) {
        if (elgg_instanceof($params['entity'], 'user')) {
@@ -145,6 +151,10 @@ function videolist_owner_block_menu($hook, $type, $return, $params) {
        return $return;
 }
 
+/**
+ * @param ElggObject $videolist_item
+ * @return string
+ */
 function videolist_url($videolist_item) {
        $guid = $videolist_item->guid;
        $title = elgg_get_friendly_title($videolist_item->title);
@@ -154,6 +164,9 @@ function videolist_url($videolist_item) {
 /**
  * Event handler for videolist
  *
+ * @param string $event
+ * @param string $object_type
+ * @param ElggObject $object
  */
 function videolist_object_notifications($event, $object_type, $object) {
        static $flag;
@@ -177,11 +190,11 @@ function videolist_object_notifications($event, $object_type, $object) {
  * Intercepts the notification on an event of new video being created and prevents a notification from going out
  * (because one will be sent on the annotation)
  *
- * @param unknown_type $hook
- * @param unknown_type $entity_type
- * @param unknown_type $returnvalue
- * @param unknown_type $params
- * @return unknown
+ * @param string $hook
+ * @param string $entity_type
+ * @param array $returnvalue
+ * @param array $params
+ * @return bool
  */
 function videolist_object_notifications_intercept($hook, $entity_type, $returnvalue, $params) {
        if (isset($params)) {
@@ -198,10 +211,11 @@ function videolist_object_notifications_intercept($hook, $entity_type, $returnva
 /**
  * Register videolist as an embed type.
  *
- * @param unknown_type $hook
- * @param unknown_type $type
- * @param unknown_type $value
- * @param unknown_type $params
+ * @param string $hook
+ * @param string $type
+ * @param array $value
+ * @param array $params
+ * @return array
  */
 function videolist_embed_get_sections($hook, $type, $value, $params) {
        $value['videolist'] = array(
@@ -216,10 +230,11 @@ function videolist_embed_get_sections($hook, $type, $value, $params) {
 /**
  * Return a list of videos for embedding
  *
- * @param unknown_type $hook
- * @param unknown_type $type
- * @param unknown_type $value
- * @param unknown_type $params
+ * @param string $hook
+ * @param string $type
+ * @param array $value
+ * @param array $params
+ * @return array
  */
 function videolist_embed_get_items($hook, $type, $value, $params) {
        $options = array(
@@ -245,13 +260,18 @@ function videolist_embed_get_items($hook, $type, $value, $params) {
 /**
  * Override the default entity icon for videoslist items
  *
+ * @param string $hook
+ * @param string $type
+ * @param string $returnvalue
+ * @param array $params
  * @return string Relative URL
  */
 function videolist_icon_url_override($hook, $type, $returnvalue, $params) {
        $videolist_item = $params['entity'];
-       $size = $params['size'];
-       
-       if($videolist_item->getSubtype() != 'videolist_item'){
+    /* @var ElggObject $videolist_item */
+    $size = $params['size'];
+
+    if($videolist_item->getSubtype() != 'videolist_item'){
                return $returnvalue;
        }
        
index 815e10b629d61448ef0156c90fb8ae74a54a7549..50102e87572a02718f3fa8d3973d40e348908b9f 100644 (file)
@@ -29,6 +29,7 @@ foreach ($items as $item) {
  * Downloads the thumbnail and saves into data folder
  *
  * @param ElggObject $item
+ * @return bool
  */
 function videolist_2012022501($item) {
 
index 38b805021e8f8b01cef5fe7644f0ac75b6a52207..24a5b5fe82b82c424ad20e3a5822fe90576dddca 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 $entity = $vars['entity'];
+/* @var ElggObject $entity */
 
 $sizes = array('small', 'medium', 'large', 'tiny', 'master', 'topbar');
 $img_width = array('tiny' => 25, 'small' => 40, 'medium' => 100, 'large' => 200);
index 6ed284a43aa9760b5316573b22fff44533a55217..e30d9d95ba13af0b7dd48feb1c5f1ca2437fb16c 100644 (file)
@@ -7,6 +7,7 @@
 
 $full = elgg_extract('full_view', $vars, FALSE);
 $entity = elgg_extract('entity', $vars, FALSE);
+/* @var ElggObject $entity */
 
 if (!$entity) {
        return TRUE;