Convert various uses of (optional) in core parameter descriptions to use the style prescribed in the inline documentation standards for PHP.

The style for marking parameters optional in inline PHP docs is: `@param type $var Optional. Description. Accepts. Default.`, where Accepts can be omitted on a case-by-case basis.

Props coffee2code.
Fixes #30591.


git-svn-id: https://develop.svn.wordpress.org/trunk@30753 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes (DrewAPicture)
2014-12-06 21:23:52 +00:00
parent 71bb091cc3
commit 7187da0b32
9 changed files with 85 additions and 68 deletions
@@ -49,10 +49,11 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
/**
* Write a string to a file
*
* @param string $file Remote path to the file where to write the data.
* @param string $file Remote path to the file where to write the data.
* @param string $contents The data to write.
* @param int $mode (optional) The file permissions as octal number, usually 0644.
* @return bool False upon failure.
* @param int $mode Optional. The file permissions as octal number, usually 0644.
* Default false.
* @return bool False upon failure, true otherwise.
*/
public function put_contents( $file, $contents, $mode = false ) {
$fp = @fopen( $file, 'wb' );
@@ -99,9 +100,9 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
/**
* Changes file group
*
* @param string $file Path to the file.
* @param mixed $group A group name or number.
* @param bool $recursive (optional) If set True changes file group recursively. Defaults to False.
* @param string $file Path to the file.
* @param mixed $group A group name or number.
* @param bool $recursive Optional. If set True changes file group recursively. Default false.
* @return bool Returns true on success or false on failure.
*/
public function chgrp($file, $group, $recursive = false) {
@@ -123,9 +124,10 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
/**
* Changes filesystem permissions
*
* @param string $file Path to the file.
* @param int $mode (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
* @param bool $recursive (optional) If set True changes file group recursively. Defaults to False.
* @param string $file Path to the file.
* @param int $mode Optional. The permissions as octal number, usually 0644 for files,
* 0755 for dirs. Default false.
* @param bool $recursive Optional. If set True changes file group recursively. Default false.
* @return bool Returns true on success or false on failure.
*/
public function chmod($file, $mode = false, $recursive = false) {
@@ -152,9 +154,10 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
/**
* Changes file owner
*
* @param string $file Path to the file.
* @param mixed $owner A user name or number.
* @param bool $recursive (optional) If set True changes file owner recursively. Defaults to False.
* @param string $file Path to the file.
* @param mixed $owner A user name or number.
* @param bool $recursive Optional. If set True changes file owner recursively.
* Default false.
* @return bool Returns true on success or false on failure.
*/
public function chown($file, $owner, $recursive = false) {
+13 -9
View File
@@ -97,8 +97,8 @@ function get_home_path() {
*
* @since 2.6.0
*
* @param string $folder Full path to folder
* @param int $levels (optional) Levels of folders to follow, Default: 100 (PHP Loop limit).
* @param string $folder Optional. Full path to folder. Default empty.
* @param int $levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
* @return bool|array False on failure, Else array of files
*/
function list_files( $folder = '', $levels = 100 ) {
@@ -137,8 +137,8 @@ function list_files( $folder = '', $levels = 100 ) {
*
* @since 2.6.0
*
* @param string $filename (optional) Filename to base the Unique file off
* @param string $dir (optional) Directory to store the file in
* @param string $filename Optional. Filename to base the Unique file off. Default empty.
* @param string $dir Optional. Directory to store the file in. Default empty.
* @return string a writable filename
*/
function wp_tempnam($filename = '', $dir = '') {
@@ -805,14 +805,18 @@ function copy_dir($from, $to, $skip_list = array() ) {
* Initialises and connects the WordPress Filesystem Abstraction classes.
* This function will include the chosen transport and attempt connecting.
*
* Plugins may add extra transports, And force WordPress to use them by returning the filename via the 'filesystem_method_file' filter.
* Plugins may add extra transports, And force WordPress to use them by returning
* the filename via the {@see 'filesystem_method_file'} filter.
*
* @since 2.5.0
*
* @param array $args (optional) Connection args, These are passed directly to the WP_Filesystem_*() classes.
* @param string $context (optional) Context for get_filesystem_method(), See function declaration for more information.
* @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
* @return null|boolean false on failure, true on success
* @param array $args Optional. Connection args, These are passed directly to
* the `WP_Filesystem_*()` classes. Default false.
* @param string $context Optional. Context for {@see get_filesystem_method()}.
* Default false.
* @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable.
* Default false.
* @return null|boolean false on failure, true on success.
*/
function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) {
global $wp_filesystem;
+8 -8
View File
@@ -1116,14 +1116,14 @@ function postbox_classes( $id, $page ) {
}
/**
* {@internal Missing Short Description}}
* Get a sample permalink based off of the post name.
*
* @since 2.5.0
*
* @param integer $id Post ID or post object.
* @param string $title (optional) Title
* @param string $name (optional) Name
* @return array With two entries of type string
* @param int $id Post ID or post object.
* @param string $title Optional. Title. Default null.
* @param string $name Optional. Name. Default null.
* @return array Arra yith two entries of type string.
*/
function get_sample_permalink($id, $title = null, $name = null) {
$post = get_post( $id );
@@ -1185,9 +1185,9 @@ function get_sample_permalink($id, $title = null, $name = null) {
*
* @since 2.5.0
*
* @param integer $id Post ID or post object.
* @param string $new_title Optional. New title.
* @param string $new_slug Optional. New slug.
* @param int $id Post ID or post object.
* @param string $new_title Optional. New title. Default null.
* @param string $new_slug Optional. New slug. Default null.
* @return string The HTML of the sample permalink slug editor.
*/
function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {