Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"ext-intl": "*",
"ext-mbstring": "*",
"ui-awesome/html": "^0.6",
"ui-awesome/html-core-component": "^0.4",
"ui-awesome/html-core-component": "^0.5@dev",
Comment thread
terabytesoftw marked this conversation as resolved.
"ui-awesome/html-helper": "^0.7",
"ui-awesome/html-interop": "^0.4",
"ui-awesome/html-mixin": "^0.8.2",
Expand Down
6 changes: 1 addition & 5 deletions src/Collector/CollectorCoordinator.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ public function capture(RequestSummary $summary): DebugSnapshot
}
}

return new DebugSnapshot(
$summary,
$panels,
$failures,
);
return new DebugSnapshot($summary, $panels, $failures);
}

/**
Expand Down
28 changes: 4 additions & 24 deletions src/Comparison/SummaryMetricComparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,9 @@ private static function formatNumber(float|int $value, string $unit, int $precis
*
* @return self Metric comparison for the two counters.
*/
private static function integerMetric(
string $label,
int $baseline,
int $target,
string|null $panelId = null,
): self {
return self::numericMetric(
$label,
$baseline,
$target,
1,
'',
$panelId,
0,
);
private static function integerMetric(string $label, int $baseline, int $target, string|null $panelId = null): self
{
return self::numericMetric($label, $baseline, $target, 1, '', $panelId, 0);
}

/**
Expand Down Expand Up @@ -181,15 +169,7 @@ private static function nullableFloatMetric(
);
}

return self::numericMetric(
$label,
$baseline,
$target,
$scale,
$unit,
$panelId,
2,
);
return self::numericMetric($label, $baseline, $target, $scale, $unit, $panelId, 2);
}

/**
Expand Down
9 changes: 1 addition & 8 deletions src/Helper/SensitiveDataRedactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,7 @@ public static function redact(

[$keyMap, $prefixes, $patterns] = self::rules($sensitiveKeys, $sensitiveKeyPrefixes, $sensitiveKeyPatterns);

return self::walk(
$value,
$keyMap,
$prefixes,
$patterns,
0,
$nodes,
);
return self::walk($value, $keyMap, $prefixes, $patterns, 0, $nodes);
}

/**
Expand Down
16 changes: 4 additions & 12 deletions src/Helper/Trace.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ private function __construct(private Closure|string|false $template, private arr
*/
public static function create(): self
{
return new self(
self::DEFAULT_TEMPLATE,
[],
);
return new self(self::DEFAULT_TEMPLATE, []);
}

/**
Expand Down Expand Up @@ -69,6 +66,7 @@ public function render(array $frame): string
}

$file = $this->mapPath(str_replace('\\', '/', $file));

$template = $this->template;

if ($template === false) {
Expand Down Expand Up @@ -122,10 +120,7 @@ public function withPathMappings(array $pathMappings): self
$normalized[self::normalizePrefix((string) $remote)] = self::normalizePrefix($target);
}

return new self(
template: $this->template,
pathMappings: $normalized,
);
return new self(template: $this->template, pathMappings: $normalized);
}

/**
Expand All @@ -140,10 +135,7 @@ public function withPathMappings(array $pathMappings): self
*/
public function withTemplate(Closure|string|false $template): self
{
return new self(
template: $template,
pathMappings: $this->pathMappings,
);
return new self(template: $template, pathMappings: $this->pathMappings);
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Panel/Asset/AssetPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ final class AssetPanel extends Panel
*/
public function present(array $data): PanelView
{
$snapshot = AssetSnapshot::fromArray(
$data,
'$.asset',
);
$snapshot = AssetSnapshot::fromArray($data, '$.asset');

$bundles = $snapshot->bundles();
$vite = $snapshot->vite();
Expand Down
5 changes: 5 additions & 0 deletions src/Panel/Config/ConfigSnapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public function data(): array
return $this->values();
}

/**
* Returns the key under which the configuration payload is stored.
*
* @return string Payload key.
*/
protected static function payloadKey(): string
{
return 'data';
Expand Down
8 changes: 8 additions & 0 deletions src/Panel/Db/DbMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
*/
enum DbMessage: string
{
/**
* Guidance of the empty state, naming the profiler the adapter must wire so statements are captured.
*
* Format: "Configure the development connection with %s. ..."
*/
case CAPTURE_GUIDANCE = 'Configure the development connection with %s. Rows are shown only when the driver '
. 'reports them. After a redirect, open the previous request from History.';

/**
* Header of the column counting how many times the exact same statement ran.
*/
Expand Down
10 changes: 8 additions & 2 deletions src/Panel/Event/EventInspection.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ public static function fromArray(mixed $data, string $path): self

foreach ($payload->map('context') as $key => $value) {
if (!is_string($value) || strlen($value) > 2048 || strlen($key) > 128) {
throw HydrationException::at("{$path}.context.{$key}", 'bounded text');
throw HydrationException::at(
"{$path}.context.{$key}",
'bounded text',
);
}

$context[$key] = $value;
Expand All @@ -67,7 +70,10 @@ public static function fromArray(mixed $data, string $path): self

foreach ($payload->list('trace') as $index => $value) {
if (!is_string($value) || strlen($value) > 2048) {
throw HydrationException::at("{$path}.trace[{$index}]", 'bounded text');
throw HydrationException::at(
"{$path}.trace[{$index}]",
'bounded text',
);
}

$trace[] = $value;
Expand Down
7 changes: 1 addition & 6 deletions src/Panel/Mail/MailEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ private function __construct(
*/
public static function create(string $from, array $to, string $subject, bool $isSuccessful): self
{
return new self(
$from,
$to,
$subject,
$isSuccessful,
);
return new self($from, $to, $subject, $isSuccessful);
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Panel/PanelRenderContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ public function panelPayload(string $panel): array|null
*/
public function panelUrl(string|null $panel = null, array|null $queryParams = null): string
{
return $this->urls->panel(
$this->tag,
$panel ?? $this->panel,
$queryParams ?? $this->queryParams,
);
return $this->urls->panel($this->tag, $panel ?? $this->panel, $queryParams ?? $this->queryParams);
}
}
2 changes: 1 addition & 1 deletion src/Panel/PanelRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private function panel(string $name, PanelView $view): string
->html(...$summary)
->render();

return $heading . $strip . $this->blocks($view->blocks());
return "{$heading}{$strip}" . $this->blocks($view->blocks());
}

/**
Expand Down
7 changes: 1 addition & 6 deletions src/Panel/Profile/ProfilingSnapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ public static function capture(int $memory, float $time, array $messages): self
$entries[] = ProfileRow::fromTiming($timing, count($entries));
}

return new self(
$memory,
$time,
$entries,
$samples,
);
return new self($memory, $time, $entries, $samples);
}

/**
Expand Down
10 changes: 2 additions & 8 deletions src/Panel/Queue/QueuePanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,7 @@ private function detail(JobRecord $record, int $index): PanelView
$url = $this->jobUrls[$index] ?? null;

if ($url !== null) {
$fields[QueueMessage::DETAILS->value] = PanelView::link(
QueueMessage::JOB_LINK->value,
$url,
);
$fields[QueueMessage::DETAILS->value] = PanelView::link(QueueMessage::JOB_LINK->value, $url);
}

$view = PanelView::create()->overview($fields, true);
Expand Down Expand Up @@ -324,9 +321,6 @@ private static function status(JobRecord $record): array
{
$status = self::STATUS[$record->eventType] ?? self::STATUS[JobRecord::TYPE_PUSH];

return PanelView::badge(
$status['label']->value,
$status['tone'],
);
return PanelView::badge($status['label']->value, $status['tone']);
}
}
7 changes: 2 additions & 5 deletions src/Panel/Request/RequestHeadersRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function render(array $request, array $response): string
->html(
H2::tag()
->id('yii-debug-header-exchange-title')
->content(RequestMessage::HEADER_EXCHANGE->value),
->content(RequestMessage::HEADER_EXCHANGE),
Div::tag()
->class('yii-debug-diagnostic-counts')
->html(
Expand Down Expand Up @@ -187,9 +187,6 @@ private static function renderLedger(array $entries, bool $response): string
);
}

return RequestDiagnosticLedger::render(
'yii-debug-header-ledger',
...$rows,
);
return RequestDiagnosticLedger::render('yii-debug-header-ledger', ...$rows);
}
}
Loading
Loading