From 538b2f856cd22838d5984e236e5ff957d34dfcdd Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Tue, 17 Nov 2026 12:46:45 +0900 Subject: [PATCH 1/2] Point the attribute docblocks to the manual --- src/Annotation/Ssr.php | 12 +++++++++--- src/Annotation/SsrCacheConfig.php | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Annotation/Ssr.php b/src/Annotation/Ssr.php index 00265f6..8c7f56a 100644 --- a/src/Annotation/Ssr.php +++ b/src/Annotation/Ssr.php @@ -7,14 +7,20 @@ use Attribute; use Ray\Di\Di\Qualifier; +/** + * Renders the response of the method on the server with the JavaScript application `app` + * + * @see https://bearsunday.github.io/manuals/1.0/en/reference.html#attributes + * @see \BEAR\SsrModule\SsrInterceptor + */ #[Attribute(Attribute::TARGET_METHOD)] #[Qualifier] final class Ssr { /** - * @param string|null $app App name - * @param array $state State keys in body - * @param array $metas Meta keys in body + * @param string|null $app Name of the JS application bundle; null throws NoAppValueException + * @param array $state Body keys sent to the client as the application state; `['*']` passes the whole body + * @param array $metas Body keys passed to the render function on the server only, such as the page title */ public function __construct( public readonly ?string $app = null, diff --git a/src/Annotation/SsrCacheConfig.php b/src/Annotation/SsrCacheConfig.php index e6f20f9..ba30005 100644 --- a/src/Annotation/SsrCacheConfig.php +++ b/src/Annotation/SsrCacheConfig.php @@ -7,6 +7,7 @@ use Attribute; use Ray\Di\Di\Qualifier; +/** Qualifies the PSR-16 cache that keeps the V8Js snapshot of each SSR application */ #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_PARAMETER)] #[Qualifier] final class SsrCacheConfig From 3908c302da8bb6d55d5bd06a28070e60e9a82380 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Tue, 17 Nov 2026 13:37:31 +0900 Subject: [PATCH 2/2] Describe where state and metas go and drop the reference table link --- src/Annotation/Ssr.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Annotation/Ssr.php b/src/Annotation/Ssr.php index 8c7f56a..89a4005 100644 --- a/src/Annotation/Ssr.php +++ b/src/Annotation/Ssr.php @@ -10,7 +10,6 @@ /** * Renders the response of the method on the server with the JavaScript application `app` * - * @see https://bearsunday.github.io/manuals/1.0/en/reference.html#attributes * @see \BEAR\SsrModule\SsrInterceptor */ #[Attribute(Attribute::TARGET_METHOD)] @@ -19,8 +18,10 @@ final class Ssr { /** * @param string|null $app Name of the JS application bundle; null throws NoAppValueException - * @param array $state Body keys sent to the client as the application state; `['*']` passes the whole body - * @param array $metas Body keys passed to the render function on the server only, such as the page title + * @param array $state Body keys passed as the first argument of the JS `render(state, metas)`; `['*']` passes + * the whole body, and a key not in the body throws StatusKeyNotExistsException + * @param array $metas Body keys passed as the second argument of the JS `render(state, metas)`; `['*']` passes + * the whole body, and a key not in the body throws MetaKeyNotExistsException */ public function __construct( public readonly ?string $app = null,