Skip to content

Commit 0e35efe

Browse files
committed
Lint fix
1 parent 285e150 commit 0e35efe

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Media_Command.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use WP_CLI\Utils;
4+
use WP_CLI\Path;
45

56
/**
67
* Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
@@ -389,7 +390,7 @@ public function import( $args, $assoc_args = array() ) {
389390
} else {
390391
$tempfile = $this->make_copy( $file );
391392
}
392-
$name = Utils\basename( $file );
393+
$name = Path::basename( $file );
393394

394395
if ( Utils\get_flag_value( $assoc_args, 'preserve-filetime' ) ) {
395396
$file_time = @filemtime( $file );
@@ -407,7 +408,7 @@ public function import( $args, $assoc_args = array() ) {
407408
++$errors;
408409
continue;
409410
}
410-
$name = (string) strtok( Utils\basename( $file ), '?' );
411+
$name = (string) strtok( Path::basename( $file ), '?' );
411412
}
412413

413414
if ( ! empty( $assoc_args['file_name'] ) ) {
@@ -453,7 +454,7 @@ public function import( $args, $assoc_args = array() ) {
453454
}
454455

455456
if ( empty( $post_array['post_title'] ) ) {
456-
$post_array['post_title'] = preg_replace( '/\.[^.]+$/', '', Utils\basename( $file ) );
457+
$post_array['post_title'] = preg_replace( '/\.[^.]+$/', '', Path::basename( $file ) );
457458
}
458459

459460
if ( Utils\get_flag_value( $assoc_args, 'skip-copy' ) ) {
@@ -684,7 +685,7 @@ private function gcd( $num1, $num2 ) {
684685
*/
685686
private function make_copy( $path ) {
686687
$dir = get_temp_dir();
687-
$filename = Utils\basename( $path );
688+
$filename = Path::basename( $path );
688689
if ( empty( $filename ) ) {
689690
$filename = (string) time();
690691
}

0 commit comments

Comments
 (0)