Skip to content

Commit 19ce162

Browse files
fix: satisfy cleanup lint checks
1 parent 94a8129 commit 19ce162

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

inc/Workspace/WorkspaceWorktreeCleanupEngine.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,6 @@ private function dedupe_worktree_cleanup_rows( array $rows ): array {
748748
$seen = array();
749749
$result = array();
750750
foreach ( $rows as $row ) {
751-
if ( ! is_array($row) ) {
752-
continue;
753-
}
754751
$key = implode('|', array(
755752
(string) ( $row['handle'] ?? '' ),
756753
(string) ( $row['path'] ?? '' ),
@@ -907,6 +904,7 @@ private function classify_worktree_git_probe_failure( string $handle, string $re
907904
* @return string
908905
*/
909906
private function get_wp_error_code( \WP_Error $error ): string {
907+
// @phpstan-ignore-next-line Smoke tests provide a minimal WP_Error stub.
910908
return method_exists($error, 'get_error_code') ? (string) $error->get_error_code() : (string) ( $error->code ?? '' );
911909
}
912910

@@ -917,6 +915,7 @@ private function get_wp_error_code( \WP_Error $error ): string {
917915
* @return mixed
918916
*/
919917
private function get_wp_error_data( \WP_Error $error ): mixed {
918+
// @phpstan-ignore-next-line Smoke tests provide a minimal WP_Error stub.
920919
return method_exists($error, 'get_error_data') ? $error->get_error_data() : ( $error->data ?? null );
921920
}
922921

@@ -1106,7 +1105,7 @@ function () use ( $repo, $branch, $wt_path, $force, $remove_timeout_seconds ) {
11061105
}
11071106

11081107
if ( array() !== array_filter($timeout_handles) ) {
1109-
$continuation['timeout_handles'] = array_values(array_filter($timeout_handles));
1108+
$continuation['timeout_handles'] = array_values(array_filter($timeout_handles));
11101109
$continuation['timeout_resume_command'] = $this->build_bounded_cleanup_resume_command($limit, $opts, $this->next_worktree_cleanup_remove_timeout($remove_timeout_seconds));
11111110
$continuation['timeout_hint'] = 'Removal timed out after passing safety checks; rerun with a larger --remove-timeout to resume the remaining cleanup-eligible rows.';
11121111
}
@@ -1762,10 +1761,6 @@ private function dedupe_worktree_cleanup_scan_rows( array $rows ): array {
17621761
$seen = array();
17631762
$result = array();
17641763
foreach ( $rows as $row ) {
1765-
if ( ! is_array($row) ) {
1766-
continue;
1767-
}
1768-
17691764
$handle = (string) ( $row['handle'] ?? '' );
17701765
$path = (string) ( $row['path'] ?? '' );
17711766
$key = '' !== $handle || '' !== $path ? $handle . '|' . $path : wp_json_encode($row);

0 commit comments

Comments
 (0)