Skip to content
PHP Ecosystem
Explore

MailPanel

API reference › Yii3 Debug › Panel › MailPanel

final classYii3\Debug\Panel\MailPanel
ExtendsProviderPanel
ImplementsCaptureToolbarProviderInterface, ToolbarPanelProviderInterface
Sourcesrc/Panel/MailPanel.php

Adapts the framework-neutral PHPForge Mail panel to the Yii3 debugger.

The detail view, the sidebar entry, and the toolbar metric match the Yii2 Mail panel: a capture that sent mail counts its own messages, and a capture that sent none but directly follows one that did, the redirect after a form post, links the metric to that request.

MethodDescriptionDefined by
__construct()Binds the adapter to the shared Mail presentation.MailPanel
hasContent()Reports whether the Mail collector captured the request.MailPanel
icon()Returns the shared Debug Core icon key.ProviderPanel
id()Returns the stable identifier of this panel.ProviderPanel
name()Returns the human-readable panel name.ProviderPanel
render()Renders the detail content the provider produces for a capture.ProviderPanel
toolbarItems()Counts the messages the capture sent.MailPanel
toolbarItemsForCapture()Counts the messages the capture sent, or links the previous request when it sent the mail instead.MailPanel
withMetadata()Returns a copy presenting the panel under the metadata the application configured.ProviderPanel
public function __construct(PHPForge\Debug\Storage\SnapshotStore $store, Yii3\Debug\Middleware\ToolbarOptions $options = new \Yii3\Debug\Middleware\ToolbarOptions())

Binds the adapter to the shared Mail presentation.

Parameters

ParameterTypeDescription
$storePHPForge\Debug\Storage\SnapshotStoreStore whose manifest locates the request that preceded a capture.
$optionsYii3\Debug\Middleware\ToolbarOptionsSettings carrying the route prefix the cross-request link is built on.
public function hasContent(array<string, mixed> $payload): bool

Reports whether the Mail collector captured the request.

A capture without messages stays listed and shows the panel empty state, as the Yii2 sidebar does.

Parameters

ParameterTypeDescription
$payloadarray<string, mixed>Serialized panel payload.

Returns

bool: true when the collector produced a payload; false otherwise.

public function toolbarItems(array<string, mixed> $payload): list<PHPForge\Debug\Toolbar\ToolbarItem>

Counts the messages the capture sent.

Parameters

ParameterTypeDescription
$payloadarray<string, mixed>Serialized panel payload.

Returns

list<PHPForge\Debug\Toolbar\ToolbarItem>: One metric carrying the message count, or an empty list when none was sent.

Throws

  • PHPForge\Debug\Storage\HydrationException: when the payload does not match the Mail snapshot schema.
public function toolbarItemsForCapture(string $tag, array<string, mixed> $payload): list<PHPForge\Debug\Toolbar\ToolbarItem>

Counts the messages the capture sent, or links the previous request when it sent the mail instead.

The previous request is the manifest entry right after the capture, newest first; a capture not listed yet falls back to the newest entry.

Parameters

ParameterTypeDescription
$tagstringTag of the capture the toolbar describes.
$payloadarray<string, mixed>Serialized panel payload of that capture.

Returns

list<PHPForge\Debug\Toolbar\ToolbarItem>: The own count, a cross-request metric linking the previous request, or an empty list when neither sent mail.

Throws

  • PHPForge\Debug\Storage\HydrationException: when the payload does not match the Mail snapshot schema.