style: give PostGuard::postType() its docblock back (re-review N-1)
unavailableType() moves below postType(), so the docblock on postType()'s return type sits on postType() again. 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:
@@ -136,15 +136,6 @@ final class PostGuard
|
||||
* so a plain `object` return type is accurate and still lets callers branch with
|
||||
* `is_wp_error()` / `instanceof WP_Error`, exactly like editable() above.
|
||||
*/
|
||||
/** The answer for a post type that is not available to the tools – the same for unknown and excluded ones. */
|
||||
public static function unavailableType(string $name): WP_Error
|
||||
{
|
||||
return Errors::notFound(
|
||||
sprintf('Inhaltstyp "%s" ist nicht verfügbar.', $name),
|
||||
'Verfügbare Inhaltstypen über lit/content-types (direkt: lit-content-types) abrufen.'
|
||||
);
|
||||
}
|
||||
|
||||
public static function postType(mixed $postType, ContentSchema $schema, string $cap): object
|
||||
{
|
||||
$name = is_string($postType) ? $postType : '';
|
||||
@@ -161,6 +152,15 @@ final class PostGuard
|
||||
return $object;
|
||||
}
|
||||
|
||||
/** The answer for a post type that is not available to the tools – the same for unknown and excluded ones. */
|
||||
public static function unavailableType(string $name): WP_Error
|
||||
{
|
||||
return Errors::notFound(
|
||||
sprintf('Inhaltstyp "%s" ist nicht verfügbar.', $name),
|
||||
'Verfügbare Inhaltstypen über lit/content-types (direkt: lit-content-types) abrufen.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a list/search query for this post type must stay restricted to the current
|
||||
* user's own entries because they lack edit_others_posts. Filtering per row after the
|
||||
|
||||
Reference in New Issue
Block a user