refactor: Rev::matches replaces the inline rev checks
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -32,4 +32,14 @@ final class Rev
|
||||
(string) $post->post_modified_gmt,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether $input carries the current rev of $post (optimistic lock of the post tools).
|
||||
*
|
||||
* @param array<string, mixed> $input
|
||||
*/
|
||||
public static function matches(array $input, WP_Post $post): bool
|
||||
{
|
||||
return isset($input['rev']) && $input['rev'] === self::ofPost($post);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user