original_string: public static function entityMenuSetup($hook, $type, $menu, $params) {
  
  		$entity = elgg_extract('entity', $params);
  
  		if (!$entity instanceof Comment) {
  			return;
  		}
  
  		if ($entity->canEdit()) {
  			$menu[] = ElggMenuItem::factory(array(
  				'name' => 'edit',
  				'text' => elgg_echo('edit'),
  				'href' => "stream/edit/$entity->guid",
  				'priority' => 800,
  				'item_class' => 'interactions-edit',
  				'data' => [
  					'icon' => 'pencil',
  				]
  			));
  		}
  
  		if ($entity->canDelete()) {
  			$menu[] = ElggMenuItem::factory(array(
  				'name' => 'delete',
  				'text' => elgg_echo('delete'),
  				'href' => "action/comment/delete?guid=$entity->guid",
  				'is_action' => true,
  				'priority' => 900,
  				'confirm' => true,
  				'item_class' => 'interactions-delete',
  				'data' => [
  					'icon' => 'delete',
  				]
  			));
  		}
  
  		return $menu;
  	}
code: public static function entityMenuSetup($hook, $type, $menu, $params) {
  
  		$entity = elgg_extract('entity', $params);
  
  		if (!$entity instanceof Comment) {
  			return;
  		}
  
  		if ($entity->canEdit()) {
  			$menu[] = ElggMenuItem::factory(array(
  				'name' => 'edit',
  				'text' => elgg_echo('edit'),
  				'href' => "stream/edit/$entity->guid",
  				'priority' => 800,
  				'item_class' => 'interactions-edit',
  				'data' => [
  					'icon' => 'pencil',
  				]
  			));
  		}
  
  		if ($entity->canDelete()) {
  			$menu[] = ElggMenuItem::factory(array(
  				'name' => 'delete',
  				'text' => elgg_echo('delete'),
  				'href' => "action/comment/delete?guid=$entity->guid",
  				'is_action' => true,
  				'priority' => 900,
  				'confirm' => true,
  				'item_class' => 'interactions-delete',
  				'data' => [
  					'icon' => 'delete',
  				]
  			));
  		}
  
  		return $menu;
  	}
code_tokens: public static function entityMenuSetup ( $ hook , $ type , $ menu , $ params ) { $ entity = elgg_extract ( 'entity' , $ params ) ; if ( ! $ entity instanceof Comment ) { return ; } if ( $ entity -> canEdit ( ) ) { $ menu [ ] = ElggMenuItem :: factory ( array ( 'name' => 'edit' , 'text' => elgg_echo ( 'edit' ) , 'href' => "stream/edit/$entity->guid" , 'priority' => 800 , 'item_class' => 'interactions-edit' , 'data' => [ 'icon' => 'pencil' , ] ) ) ; } if ( $ entity -> canDelete ( ) ) { $ menu [ ] = ElggMenuItem :: factory ( array ( 'name' => 'delete' , 'text' => elgg_echo ( 'delete' ) , 'href' => "action/comment/delete?guid=$entity->guid" , 'is_action' => true , 'priority' => 900 , 'confirm' => true , 'item_class' => 'interactions-delete' , 'data' => [ 'icon' => 'delete' , ] ) ) ; } return $ menu ; }
docstring: Setups comment menu
  
  @param string $hook   "register"
  @param string $type   "menu:interactions"
  @param array  $menu   Menu
  @param array  $params Hook parameters
  @return array
docstring_tokens: Setups comment menu