Changeset 45607 for trunk/tests/phpunit/includes/mock-fs.php
- Timestamp:
- 07/08/2019 12:55:20 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/mock-fs.php
r42343 r45607 62 62 foreach ( $paths as $path ) { 63 63 // Allow for comments 64 if ( '#' == $path[0] ) {64 if ( '#' === $path[0] ) { 65 65 continue; 66 66 } 67 67 68 68 // Directories 69 if ( '/' == $path[ strlen( $path ) - 1 ] ) {69 if ( '/' === $path[ strlen( $path ) - 1 ] ) { 70 70 $this->mkdir( $path ); 71 71 } else { // Files (with dummy content for now) … … 162 162 function dirlist( $path = '.', $include_hidden = true, $recursive = false ) { 163 163 164 if ( empty( $path ) || '.' == $path ) {164 if ( empty( $path ) || '.' === $path ) { 165 165 $path = $this->cwd(); 166 166 } … … 178 178 $ret = array(); 179 179 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 ) { 189 189 continue; 190 190 } … … 194 194 $struc['type'] = $entry->type; 195 195 196 if ( 'd' == $struc['type'] ) {196 if ( 'd' === $struc['type'] ) { 197 197 if ( $recursive ) { 198 198 $struc['files'] = $this->dirlist( trailingslashit( $path ) . trailingslashit( $struc['name'] ), $include_hidden, $recursive ); … … 220 220 221 221 function is_file() { 222 return $this->type == 'f';222 return 'f' === $this->type; 223 223 } 224 224 225 225 function is_dir() { 226 return $this->type == 'd';226 return 'd' === $this->type; 227 227 } 228 228 }
Note: See TracChangeset
for help on using the changeset viewer.