Make WordPress Core


Ignore:
Timestamp:
05/29/2015 08:16:22 PM (9 years ago)
Author:
wonderboymusic
Message:

Add missing doc blocks to wp-admin/includes/*.
Fix some egregious uses of tabbing.
Some functions can simply return apply_filters(...) instead of setting a variable that is immediately returned.

See #32444.

File:
1 edited

Legend:

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

    r31686 r32654  
    4343    public $keys = false;
    4444
    45     public function __construct($opt='') {
     45    /**
     46     *
     47     * @param array $opt
     48     */
     49    public function __construct( $opt = '' ) {
    4650        $this->method = 'ssh2';
    4751        $this->errors = new WP_Error();
     
    9094            $this->options['password'] = $opt['password'];
    9195        }
    92 
    93     }
    94 
     96    }
     97
     98    /**
     99     *
     100     * @return bool
     101     */
    95102    public function connect() {
    96103        if ( ! $this->keys ) {
     
    127134     * @return bool|string
    128135     */
    129     public function run_command( $command, $returnbool = false) {
    130 
     136    public function run_command( $command, $returnbool = false ) {
    131137        if ( ! $this->link )
    132138            return false;
     
    167173
    168174    /**
    169      * @param string $file
    170      * @param string $contents
     175     * @param string   $file
     176     * @param string   $contents
    171177     * @param bool|int $mode
    172178     * @return bool
     
    183189    }
    184190
     191    /**
     192     *
     193     * @return bool
     194     */
    185195    public function cwd() {
    186196        $cwd = $this->run_command('pwd');
     
    202212     * @param string $file
    203213     * @param string $group
    204      * @param bool $recursive
     214     * @param bool   $recursive
     215     *
     216     * @return bool
    205217     */
    206218    public function chgrp($file, $group, $recursive = false ) {
     
    214226    /**
    215227     * @param string $file
    216      * @param int $mode
    217      * @param bool $recursive
     228     * @param int    $mode
     229     * @param bool   $recursive
    218230     * @return bool|string
    219231     */
     
    290302
    291303    /**
     304     * @param string   $source
     305     * @param string   $destination
     306     * @param bool     $overwrite
     307     * @param int|bool $mode
     308     * @return bool
     309     */
     310    public function copy($source, $destination, $overwrite = false, $mode = false) {
     311        if ( ! $overwrite && $this->exists($destination) )
     312            return false;
     313        $content = $this->get_contents($source);
     314        if ( false === $content)
     315            return false;
     316        return $this->put_contents($destination, $content, $mode);
     317    }
     318
     319    /**
    292320     * @param string $source
    293321     * @param string $destination
    294      * @param bool $overwrite
    295      * @param int|bool $mode
    296      * @return bool
    297      */
    298     public function copy($source, $destination, $overwrite = false, $mode = false) {
    299         if ( ! $overwrite && $this->exists($destination) )
    300             return false;
    301         $content = $this->get_contents($source);
    302         if ( false === $content)
    303             return false;
    304         return $this->put_contents($destination, $content, $mode);
    305     }
    306 
    307     /**
    308      * @param string $source
    309      * @param string $destination
    310      * @param bool $overwrite
     322     * @param bool   $overwrite
    311323     * @return bool
    312324     */
     
    316328
    317329    /**
    318      * @param string $file
    319      * @param bool $recursive
     330     * @param string      $file
     331     * @param bool        $recursive
    320332     * @param string|bool $type
    321333     * @return bool
     
    404416    /**
    405417     * @param string $file
    406      * @param int $time
    407      * @param int $atime
     418     * @param int    $time
     419     * @param int    $atime
    408420     */
    409421    public function touch($file, $time = 0, $atime = 0) {
     
    413425    /**
    414426     * @param string $path
    415      * @param mixed $chmod
    416      * @param mixed $chown
    417      * @param mixed $chgrp
     427     * @param mixed  $chmod
     428     * @param mixed  $chown
     429     * @param mixed  $chgrp
    418430     * @return bool
    419431     */
     
    436448    /**
    437449     * @param string $path
    438      * @param bool $recursive
     450     * @param bool   $recursive
    439451     * @return bool
    440452     */
     
    445457    /**
    446458     * @param string $path
    447      * @param bool $include_hidden
    448      * @param bool $recursive
     459     * @param bool   $include_hidden
     460     * @param bool   $recursive
    449461     * @return bool|array
    450462     */
Note: See TracChangeset for help on using the changeset viewer.