diff --git a/src/JSHandle/JSHandle.php b/src/JSHandle/JSHandle.php index 6a62fc2..6901f00 100644 --- a/src/JSHandle/JSHandle.php +++ b/src/JSHandle/JSHandle.php @@ -17,7 +17,10 @@ use Playwright\Transport\TransportInterface; /** - * @see https://playwright.dev/docs/api/class-jshandle + * Represents an in-page JavaScript object. + * + * The handle keeps a reference to a value evaluated in the page's JavaScript context. + * Dispose it when the handle is no longer needed to release browser resources. */ final class JSHandle implements JSHandleInterface { diff --git a/src/Video/Video.php b/src/Video/Video.php index cd44c1c..12971d8 100644 --- a/src/Video/Video.php +++ b/src/Video/Video.php @@ -17,7 +17,10 @@ use Playwright\Transport\TransportInterface; /** - * @see https://playwright.dev/docs/api/class-video + * Represents a recorded page video. + * + * The video exposes the local recording path and lets callers save or delete the file. + * File operations wait for the browser to finish writing the recording when needed. */ final class Video implements VideoInterface { diff --git a/src/Video/VideoInterface.php b/src/Video/VideoInterface.php index 1b93ab2..ab60b06 100644 --- a/src/Video/VideoInterface.php +++ b/src/Video/VideoInterface.php @@ -15,24 +15,38 @@ namespace Playwright\Video; /** + * Represents a recorded page video. + * + * A video becomes available when its owning page or context finishes recording. + * Save or delete its local file after the browser has completed the recording. + * * @see https://playwright.dev/docs/api/class-video */ interface VideoInterface { /** - * Deletes the video file. Will wait for the video to finish if necessary. + * Deletes the recording file. + * + * Waits for the browser to finish writing the video when necessary. + * The video cannot be saved from this object after deletion. */ public function delete(): void; /** - * Returns the file system path this video will be recorded to. + * Returns the recording path. + * + * The path identifies the local file assigned to this video. + * The file may not exist until the browser finishes recording. */ public function path(): string; /** - * Saves the video to a user-specified path. + * Saves the recording to a path. + * + * Waits for the browser to finish writing the source video when necessary. + * Creates the target directory when the implementation can do so. * - * @param string $path Path where the video should be saved + * @param string $path Target file path */ public function saveAs(string $path): void; } diff --git a/src/WebError/WebError.php b/src/WebError/WebError.php index 0debd54..ea5b453 100644 --- a/src/WebError/WebError.php +++ b/src/WebError/WebError.php @@ -17,7 +17,10 @@ use Playwright\Page\PageInterface; /** - * @see https://playwright.dev/docs/api/class-weberror + * Represents an unhandled page error. + * + * The error retains the exception reported by the browser runtime. + * The originating page is available when Playwright can associate one with the error. */ final class WebError implements WebErrorInterface { diff --git a/src/WebError/WebErrorInterface.php b/src/WebError/WebErrorInterface.php index d0757c5..caa3371 100644 --- a/src/WebError/WebErrorInterface.php +++ b/src/WebError/WebErrorInterface.php @@ -17,17 +17,28 @@ use Playwright\Page\PageInterface; /** + * Represents an unhandled page error. + * + * The exception comes from browser runtime code that did not handle it. + * A page is included when Playwright can associate the error with one. + * * @see https://playwright.dev/docs/api/class-weberror */ interface WebErrorInterface { /** - * Unhandled error object. + * Returns the reported exception. + * + * The exception preserves the error type and message from the runtime. + * Inspect it to classify or report the unhandled browser error. */ public function error(): \Throwable; /** - * The page that produced this unhandled exception, if any. + * Returns the originating page. + * + * A null result means the runtime did not associate the error with a page. + * The returned page can identify its URL or owning browser context. */ public function page(): ?PageInterface; } diff --git a/src/WebSocket/WebSocket.php b/src/WebSocket/WebSocket.php index 6964df9..217a2e4 100644 --- a/src/WebSocket/WebSocket.php +++ b/src/WebSocket/WebSocket.php @@ -21,10 +21,10 @@ use Playwright\WebSocket\Options\WaitForEventOptions; /** - * WebSocket implementation aligned with Playwright's WebSocket API. - * Supported events: 'close', 'framereceived', 'framesent', 'socketerror'. + * Represents a page WebSocket. * - * @see https://playwright.dev/docs/api/class-websocket + * The socket exposes its URL and sends frames through the active page connection. + * Browser events report closes, frames, and errors through the event dispatcher. */ final class WebSocket implements WebSocketInterface, EventDispatcherInterface { diff --git a/src/WebSocket/WebSocketInterface.php b/src/WebSocket/WebSocketInterface.php index 30740e5..e8e8aec 100644 --- a/src/WebSocket/WebSocketInterface.php +++ b/src/WebSocket/WebSocketInterface.php @@ -16,6 +16,12 @@ use Playwright\WebSocket\Options\WaitForEventOptions; +/** + * Represents a page WebSocket. + * + * The socket exposes its URL and browser-emitted lifecycle or frame events. + * Send frames or wait for socket activity through the active page connection. + */ interface WebSocketInterface { /** diff --git a/src/Worker/Worker.php b/src/Worker/Worker.php index 01a9001..8494af8 100644 --- a/src/Worker/Worker.php +++ b/src/Worker/Worker.php @@ -19,7 +19,10 @@ use Playwright\Transport\TransportInterface; /** - * @see https://playwright.dev/docs/api/class-worker + * Represents a web worker. + * + * JavaScript runs in the worker's own execution context. + * Returned handles stay associated with that worker until they are disposed. */ final class Worker implements WorkerInterface {