Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#45593 closed enhancement (fixed)

Docs: Parameter '$plugin_editable_files' type is not compatible with declaration

Reported by: subrataemfluence Owned by: pento
Priority: normal Milestone: 5.1
Component: Plugins Version: 5.0
Severity: normal Keywords: has-patch good-first-bug
Cc: Focuses: docs

Description

The parameter $plugin_editable_files accepts an array in the following function but the in Doc block, it has been defined as string, which is incorrect. It has to be declared as an array.

<?php
/**
 * Makes a tree structure for the Plugin Editor's file list.
 *
 * @since 4.9.0
 * @access private
 *
 * @param string $plugin_editable_files List of plugin file paths.
 * ...
 */
function wp_make_plugin_file_tree( $plugin_editable_files ) {
  $tree_list = array();
  foreach ( $plugin_editable_files as $plugin_file ) {
     ...
  }
  return $tree_list;
}

Here is a call made in plugin-editor.php

<?php
$plugin_editable_files = array();
foreach ( $plugin_files as $plugin_file ) {
  ...
  $plugin_editable_files[] = $plugin_file;
}

...
wp_print_plugin_file_tree( wp_make_plugin_file_tree( $plugin_editable_files ) );
...

where $plugin_editable_files is passed as an array.

Attachments (1)

45593.patch​ (569 bytes ) - added by subrataemfluence 8 years ago.

Download all attachments as: .zip

Change History (5)

#1 @mukesh27
8 years ago

  • Focuses docs added; coding-standards removed
  • Keywords good-first-bug added
  • Summary Type compatibility: Parameter '$plugin_editable_files' type is not compatible with declaration → Docs: Parameter '$plugin_editable_files' type is not compatible with declaration
  • Type defect (bug) → enhancement

#2 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review → 5.1
  • Owner set to SergeyBiryukov
  • Status new → reviewing

#3 @pento
8 years ago

  • Owner changed from SergeyBiryukov to pento
  • Status reviewing → accepted

#4 @pento
8 years ago

  • Resolution → fixed
  • Status accepted → closed

In 44464:

Docs: Fix the @param type for wp_make_plugin_file_tree().

$plugin_editable_files is an array, not a string.

Props subrataemfluence.
Fixes #45593.

Note: See TracTickets for help on using tickets.