Make WordPress Core


Ignore:
Timestamp:
08/09/2022 11:32:01 AM (2 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-ftpsockets.php

    r53862 r53872  
    418418     *              and file size to check for file existence.
    419419     *
    420      * @param string $file Path to file or directory.
    421      * @return bool Whether $file exists or not.
    422      */
    423     public function exists( $file ) {
    424         if ( $this->is_dir( $file ) ) {
     420     * @param string $path Path to file or directory.
     421     * @return bool Whether $path exists or not.
     422     */
     423    public function exists( $path ) {
     424        if ( $this->is_dir( $path ) ) {
    425425            return true;
    426426        }
    427427
    428         return is_numeric( $this->size( $file ) );
     428        return is_numeric( $this->size( $path ) );
    429429    }
    430430
     
    485485     * @since 2.5.0
    486486     *
    487      * @param string $file Path to file or directory.
    488      * @return bool Whether $file is writable.
    489      */
    490     public function is_writable( $file ) {
     487     * @param string $path Path to file or directory.
     488     * @return bool Whether $path is writable.
     489     */
     490    public function is_writable( $path ) {
    491491        return true;
    492492    }
Note: See TracChangeset for help on using the changeset viewer.