Skip to content

Commit 0808078

Browse files
committed
fix: satisfy cleanup lint
1 parent 95fe26a commit 0808078

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

inc/Cleanup/CleanupRemainingWorkSummary.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ public static function from_items( array $items ): array {
2525
$summary = self::empty_summary();
2626

2727
foreach ( $items as $item ) {
28-
if ( ! is_array($item) ) {
29-
continue;
30-
}
31-
3228
$type = (string) ( $item['item_type'] ?? 'unknown' );
3329
$status = (string) ( $item['status'] ?? 'unknown' );
3430
$evidence = (array) ( $item['evidence'] ?? array() );

inc/Cli/Commands/WorkspaceCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ private function render_cleanup_progress_summary( array $progress ): void {
847847
'metric'
848848
);
849849
if ( ! empty($progress['note']) ) {
850-
WP_CLI::log((string) $progress['note']);
850+
WP_CLI::log( (string) $progress['note']);
851851
}
852852
}
853853

inc/Workspace/CleanupRunService.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
class CleanupRunService {
1616

17-
private const DEFAULT_APPLY_LIMIT = 25;
18-
private const MAX_APPLY_LIMIT = 100;
17+
private const DEFAULT_APPLY_LIMIT = 25;
18+
private const MAX_APPLY_LIMIT = 100;
1919
private const WORKTREE_APPLY_BATCH_LIMIT = 1;
2020

2121

@@ -102,9 +102,9 @@ public function apply( string $run_id, array $opts = array() ): array|\WP_Error
102102
$results = array();
103103

104104
if ( array() !== $artifact_rows ) {
105-
$artifact_batch = array_slice($artifact_rows, 0, $limit);
106-
$processed_rows += count($artifact_batch);
107-
$batch_type = 'artifact_cleanup';
105+
$artifact_batch = array_slice($artifact_rows, 0, $limit);
106+
$processed_rows += count($artifact_batch);
107+
$batch_type = 'artifact_cleanup';
108108
$this->mark_batch_applying($artifact_batch, $run_id, $batch_type, $limit, $remaining_rows);
109109
$results['artifact_cleanup'] = $this->workspace->worktree_cleanup_artifacts(
110110
array(
@@ -118,9 +118,9 @@ public function apply( string $run_id, array $opts = array() ): array|\WP_Error
118118

119119
$remaining_capacity = max(0, $limit - $processed_rows);
120120
if ( $remaining_capacity > 0 && array() !== $worktree_rows ) {
121-
$worktree_batch = array_slice($worktree_rows, 0, min($remaining_capacity, self::WORKTREE_APPLY_BATCH_LIMIT));
122-
$processed_rows += count($worktree_batch);
123-
$batch_type = '' === $batch_type ? 'worktree_removal' : 'mixed';
121+
$worktree_batch = array_slice($worktree_rows, 0, min($remaining_capacity, self::WORKTREE_APPLY_BATCH_LIMIT));
122+
$processed_rows += count($worktree_batch);
123+
$batch_type = '' === $batch_type ? 'worktree_removal' : 'mixed';
124124
$this->mark_batch_applying($worktree_batch, $run_id, $batch_type, $limit, $remaining_rows);
125125
$results['worktree_removal'] = $this->workspace->worktree_cleanup_merged(
126126
array(

0 commit comments

Comments
 (0)