Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Makarov <[email protected]>
  • Loading branch information
xepozz and samdark authored Jan 6, 2024
1 parent da90fea commit 266360b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 24 deletions.
10 changes: 4 additions & 6 deletions docs/en/collector.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Collector

## Collectors
# Collectors

Yii Debug uses a concept named "collectors".
Each collector decides what payload it needs to collect and exports the collected payload in order to save it into storage.

A collector may work either both with HTTP requests and console runs, or individually.
A collector may work either with both HTTP requests and console runs, or individually.
A collector may be either an event listener or a decorator to any service defined in the application DI container configuration.

Take a look at the [`Yiisoft\Yii\Debug\Collector\CollectorInterface`](./src/Collector/CollectorInterface.php):
Expand Down Expand Up @@ -39,7 +37,7 @@ interface CollectorInterface
}
```

Use the trait to reduce the duplication of code and any possible bugs: [`\Yiisoft\Yii\Debug\Collector\CollectorTrait`](./src/Collector/CollectorTrait.php)
Use the trait to reduce the duplication of code and avoid possible bugs: [`\Yiisoft\Yii\Debug\Collector\CollectorTrait`](./src/Collector/CollectorTrait.php)

All you need to create a collector is to implement the interface and register it in the configuration.

Expand All @@ -62,7 +60,7 @@ class MyCollector implements \Yiisoft\Yii\Debug\Collector\CollectorInterface
}
```

When you implement collecting payload, it is also a good idea to implement data reset. With `CollectorTrait` it is as simple as adding `reset` method:
If you implement data collection, it's also a good idea to implement data reset. With `CollectorTrait` it's as simple as adding `reset()` method:
```php
private function reset(): void
{
Expand Down
4 changes: 1 addition & 3 deletions docs/en/collector/service.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Collectors

## Service collector
# Service collector

`ServiceCollector` is a collector that listens all tracked services and collects its arguments, results and errors.

Expand Down
6 changes: 1 addition & 5 deletions docs/en/collector/summary.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Collectors

Read more about collectors in the [Collector](../collector.md) section.

## Summary collector
# Summary collector

Summary collector is a collector that provides additional "summary" payload.
The summary payload is used to reduce time to read usual payload and summarise some metrics to get better UX.
Expand Down
4 changes: 1 addition & 3 deletions docs/en/command-container.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Console commands

## `debug:container`
# `debug:container`

The `debug/container` command displays all registered services and config groups.

Expand Down
4 changes: 1 addition & 3 deletions docs/en/command-events.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Console commands

## `debug:events`
# `debug:events`

The `debug/events` command displays all registered events and their listeners.

Expand Down
4 changes: 1 addition & 3 deletions docs/en/command-reset.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Console commands

## `debug:reset`
# `debug:reset`

The `debug/reset` command cleans all collected data. It's similar to `rm -rf runtime/debug` if you use file storage,
but may be also useful if you use another storage driver.
2 changes: 1 addition & 1 deletion docs/en/filtering.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Filtering

Disabling debugging for certain requests or console commands may help you to debug in production or not to flood the debug storage with useful payloads.
Disabling debugging for certain requests or console commands may help you to debug in production or not to flood the debug storage with useless payloads.

You can specify which routes should not trigger the Debug extension by adding the ones into the configuration:

Expand Down

0 comments on commit 266360b

Please sign in to comment.