Skip to content

Commit bde3f09

Browse files
committed
Lint fixes
1 parent d1270c0 commit bde3f09

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/Context/FeatureContext.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use WP_CLI\Process;
2525
use WP_CLI\ProcessRun;
2626
use WP_CLI\Utils;
27+
use WP_CLI\Path;
2728
use WP_CLI\WpOrgApi;
2829

2930
/**
@@ -1911,8 +1912,8 @@ private static function get_scenario_key( $scope ): string {
19111912
$scenario_key = '';
19121913
$file = self::get_event_file( $scope, $line );
19131914
if ( isset( $file ) ) {
1914-
$scenario_grandparent = Utils\basename( dirname( $file, 2 ) );
1915-
$scenario_key = $scenario_grandparent . ' ' . Utils\basename( $file ) . ':' . $line;
1915+
$scenario_grandparent = Path::basename( dirname( $file, 2 ) );
1916+
$scenario_key = $scenario_grandparent . ' ' . Path::basename( $file ) . ':' . $line;
19161917
}
19171918
return $scenario_key;
19181919
}
@@ -1929,7 +1930,7 @@ private static function log_run_times_after_suite( AfterSuiteScope $scope ): voi
19291930
$suite = substr( $keys[0], 0, strpos( $keys[0], ' ' ) );
19301931
}
19311932

1932-
$run_from = Utils\basename( dirname( __DIR__, 2 ) );
1933+
$run_from = Path::basename( dirname( __DIR__, 2 ) );
19331934

19341935
// Format same as Behat, if have minutes.
19351936
$fmt = static function ( $time ) {

src/Context/GivenStepDefinitions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Behat\Gherkin\Node\TableNode;
77
use RuntimeException;
88
use WP_CLI\Utils;
9+
use WP_CLI\Path;
910

1011
trait GivenStepDefinitions {
1112

@@ -45,7 +46,7 @@ public function given_an_empty_directory(): void {
4546
*/
4647
public function given_a_specific_directory( $empty_or_nonexistent, $dir ): void {
4748
$dir = $this->replace_variables( $dir );
48-
if ( ! Utils\is_path_absolute( $dir ) ) {
49+
if ( ! Path::is_absolute( $dir ) ) {
4950
$dir = $this->variables['RUN_DIR'] . "/$dir";
5051
}
5152

src/Context/ThenStepDefinitions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Behat\Gherkin\Node\PyStringNode;
66
use Behat\Gherkin\Node\TableNode;
77
use WP_CLI\Utils;
8+
use WP_CLI\Path;
89
use Exception;
910
use Requests;
1011
use RuntimeException;
@@ -457,7 +458,7 @@ public function then_a_specific_file_folder_should_exist( $path, $type, $strictl
457458
$path = $this->replace_variables( $path );
458459

459460
// If it's a relative path, make it relative to the current test dir.
460-
if ( ! Utils\is_path_absolute( $path ) ) {
461+
if ( ! Path::is_absolute( $path ) ) {
461462
$path = $this->variables['RUN_DIR'] . DIRECTORY_SEPARATOR . $path;
462463
}
463464

0 commit comments

Comments
 (0)