Make WordPress Core


Ignore:
Timestamp:
05/03/2023 09:28:11 PM (19 months ago)
Author:
johnbillion
Message:

Filesystem API: Correct and improve the return type documentation for the dirlist() method in WP_Filesystem_Base and its extending classes.

Props mat-lipe, szepeviktor, costdev, audrasjb, johnbillion

Fixes #58229
See #57840

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php

    r55556 r55714  
    603603    /**
    604604     * @param string $line
    605      * @return array
     605     * @return array {
     606     *     Array of file information.
     607     *
     608     *     @type string       $name        Name of the file or directory.
     609     *     @type string       $perms       *nix representation of permissions.
     610     *     @type string       $permsn      Octal representation of permissions.
     611     *     @type string|false $number      File number as a string, or false if not available.
     612     *     @type string|false $owner       Owner name or ID, or false if not available.
     613     *     @type string|false $group       File permissions group, or false if not available.
     614     *     @type string|false $size        Size of file in bytes as a string, or false if not available.
     615     *     @type string|false $lastmodunix Last modified unix timestamp as a string, or false if not available.
     616     *     @type string|false $lastmod     Last modified month (3 letters) and day (without leading 0), or
     617     *                                     false if not available.
     618     *     @type string|false $time        Last modified time, or false if not available.
     619     *     @type string       $type        Type of resource. 'f' for file, 'd' for directory, 'l' for link.
     620     *     @type array|false  $files       If a directory and `$recursive` is true, contains another array of files.
     621     *                                     False if unable to list directory contents.
     622     * }
    606623     */
    607624    public function parselisting( $line ) {
     
    713730     *                               Default false.
    714731     * @return array|false {
    715      *     Array of files. False if unable to list directory contents.
    716      *
    717      *     @type string $name        Name of the file or directory.
    718      *     @type string $perms       *nix representation of permissions.
    719      *     @type string $permsn      Octal representation of permissions.
    720      *     @type string $owner       Owner name or ID.
    721      *     @type int    $size        Size of file in bytes.
    722      *     @type int    $lastmodunix Last modified unix timestamp.
    723      *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).
    724      *     @type int    $time        Last modified time.
    725      *     @type string $type        Type of resource. 'f' for file, 'd' for directory.
    726      *     @type mixed  $files       If a directory and `$recursive` is true, contains another array of files.
     732     *     Array of arrays containing file information. False if unable to list directory contents.
     733     *
     734     *     @type array $0... {
     735     *         Array of file information. Note that some elements may not be available on all filesystems.
     736     *
     737     *         @type string           $name        Name of the file or directory.
     738     *         @type string           $perms       *nix representation of permissions.
     739     *         @type string           $permsn      Octal representation of permissions.
     740     *         @type int|string|false $number      File number. May be a numeric string. False if not available.
     741     *         @type string|false     $owner       Owner name or ID, or false if not available.
     742     *         @type string|false     $group       File permissions group, or false if not available.
     743     *         @type int|string|false $size        Size of file in bytes. May be a numeric string.
     744     *                                             False if not available.
     745     *         @type int|string|false $lastmodunix Last modified unix timestamp. May be a numeric string.
     746     *                                             False if not available.
     747     *         @type string|false     $lastmod     Last modified month (3 letters) and day (without leading 0), or
     748     *                                             false if not available.
     749     *         @type string|false     $time        Last modified time, or false if not available.
     750     *         @type string           $type        Type of resource. 'f' for file, 'd' for directory, 'l' for link.
     751     *         @type array|false      $files       If a directory and `$recursive` is true, contains another array of
     752     *                                             files. False if unable to list directory contents.
     753     *     }
    727754     * }
    728755     */
Note: See TracChangeset for help on using the changeset viewer.