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-ssh2.php

    r52807 r53872  
    558558     * @since 2.7.0
    559559     *
    560      * @param string $file Path to file or directory.
    561      * @return bool Whether $file exists or not.
    562      */
    563     public function exists( $file ) {
    564         return file_exists( $this->sftp_path( $file ) );
     560     * @param string $path Path to file or directory.
     561     * @return bool Whether $path exists or not.
     562     */
     563    public function exists( $path ) {
     564        return file_exists( $this->sftp_path( $path ) );
    565565    }
    566566
     
    606606     * @since 2.7.0
    607607     *
    608      * @param string $file Path to file or directory.
    609      * @return bool Whether $file is writable.
    610      */
    611     public function is_writable( $file ) {
     608     * @param string $path Path to file or directory.
     609     * @return bool Whether $path is writable.
     610     */
     611    public function is_writable( $path ) {
    612612        // PHP will base its writable checks on system_user === file_owner, not ssh_user === file_owner.
    613613        return true;
Note: See TracChangeset for help on using the changeset viewer.