You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(lint): clean up 34 pre-existing phpcs errors blocking releases (#420)
Auto-fix via phpcbf for alignment/array-spacing/brace-placement errors,
plus minimal hand-edits for:
- 11 SQL errors in WorkspaceLockStore, CleanupRunRepository,
WorktreeInventoryRepository: added `phpcs:ignore` for
WordPress.DB.PreparedSQL warnings on internally-controlled table
names ($wpdb->prefix + schema constants, never user input).
- 1 `count()` in loop condition in DataMachineJobCleanupRunEvidenceStore:
extracted to $max_unit variable.
- 2 short ternary errors in WorkspacePreloadArtifact and GitHub.php:
expanded to full ternary (with `phpcs:ignore` on the GitHub one to
avoid double-encoding side effect of repeated wp_json_encode call).
- 2 Yoda condition errors in CleanupRunService and
WorkspaceWorktreeLifecycle: swapped operand order.
Reverted unsafe phpcbf changes that introduced behavior changes:
- WordPressRuntimeInspector / WorkspaceWorktreeLifecycle /
WorktreeContextInjector: phpcbf replaced @file_get_contents() with
$wp_filesystem->get_contents(), which fails when $wp_filesystem is
not initialized and ignores offset/length args. Reverted to native
calls with `phpcs:ignore` comments documenting the trust boundary.
Smoke test `smoke-github-fetch-by-number` was asserting on whitespace
in GitHub.php source via strpos — updated to match the new
phpcs-compliant alignment.
Closes#419
Errors: 33 -> 0. No behavior changes.
@@ -117,7 +119,9 @@ public function get_run( string $run_id ): ?array {
117
119
publicfunctionget_items( string$run_id ): array {
118
120
global$wpdb;
119
121
122
+
// phpcs:disable WordPress.DB.PreparedSQL -- Table name from $wpdb->prefix, not user input.
120
123
$rows = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM ' . CleanupSchema::items_table() . ' WHERE run_id = %s ORDER BY id ASC', $run_id ), ARRAY_A );
0 commit comments