Make WordPress Core


Ignore:
Timestamp:
08/09/2022 11:32:01 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the $file parameter to $path in some WP_Filesystem_* methods.

This aims to bring more clarity to the code, and applies to methods where the path can be a file or a directory:

  • WP_Filesystem_*::exists()
  • WP_Filesystem_*::is_writable()

Follow-up to [6779], [25560].

See #55647.

File:
1 edited

Legend:

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

    r52332 r53872  
    400400     * @since 2.5.0
    401401     *
    402      * @param string $file Path to file or directory.
    403      * @return bool Whether $file exists or not.
    404      */
    405     public function exists( $file ) {
    406         return @file_exists( $file );
     402     * @param string $path Path to file or directory.
     403     * @return bool Whether $path exists or not.
     404     */
     405    public function exists( $path ) {
     406        return @file_exists( $path );
    407407    }
    408408
     
    448448     * @since 2.5.0
    449449     *
    450      * @param string $file Path to file or directory.
    451      * @return bool Whether $file is writable.
    452      */
    453     public function is_writable( $file ) {
    454         return @is_writable( $file );
     450     * @param string $path Path to file or directory.
     451     * @return bool Whether $path is writable.
     452     */
     453    public function is_writable( $path ) {
     454        return @is_writable( $path );
    455455    }
    456456
Note: See TracChangeset for help on using the changeset viewer.