WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/08/2019 12:55:20 AM (2 years ago)
Author:
pento
Message:

Coding Standards: Fix the remaining issues in /tests.

All PHP files in /tests now conform to the PHP coding standards, or have exceptions appropriately marked.

Travis now also runs phpcs on the /tests directory, any future changes to these files must conform entirely to the WordPress PHP coding standards. 🎉

See #47632.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/mock-fs.php

    r42343 r45607  
    6262        foreach ( $paths as $path ) {
    6363            // Allow for comments
    64             if ( '#' == $path[0] ) {
     64            if ( '#' === $path[0] ) {
    6565                continue;
    6666            }
    6767
    6868            // Directories
    69             if ( '/' == $path[ strlen( $path ) - 1 ] ) {
     69            if ( '/' === $path[ strlen( $path ) - 1 ] ) {
    7070                $this->mkdir( $path );
    7171            } else { // Files (with dummy content for now)
     
    162162    function dirlist( $path = '.', $include_hidden = true, $recursive = false ) {
    163163
    164         if ( empty( $path ) || '.' == $path ) {
     164        if ( empty( $path ) || '.' === $path ) {
    165165            $path = $this->cwd();
    166166        }
     
    178178        $ret = array();
    179179        foreach ( $this->fs_map[ $path ]->children as $entry ) {
    180             if ( '.' == $entry->name || '..' == $entry->name ) {
    181                 continue;
    182             }
    183 
    184             if ( ! $include_hidden && '.' == $entry->name ) {
    185                 continue;
    186             }
    187 
    188             if ( $limit_file && $entry->name != $limit_file ) {
     180            if ( '.' === $entry->name || '..' === $entry->name ) {
     181                continue;
     182            }
     183
     184            if ( ! $include_hidden && '.' === $entry->name ) {
     185                continue;
     186            }
     187
     188            if ( $limit_file && $entry->name !== $limit_file ) {
    189189                continue;
    190190            }
     
    194194            $struc['type'] = $entry->type;
    195195
    196             if ( 'd' == $struc['type'] ) {
     196            if ( 'd' === $struc['type'] ) {
    197197                if ( $recursive ) {
    198198                    $struc['files'] = $this->dirlist( trailingslashit( $path ) . trailingslashit( $struc['name'] ), $include_hidden, $recursive );
     
    220220
    221221    function is_file() {
    222         return $this->type == 'f';
     222        return 'f' === $this->type;
    223223    }
    224224
    225225    function is_dir() {
    226         return $this->type == 'd';
     226        return 'd' === $this->type;
    227227    }
    228228}
Note: See TracChangeset for help on using the changeset viewer.