Skip to content

Commit

Permalink
13
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Dec 19, 2024
1 parent 8e32931 commit 8d3dd49
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/Collector/Stream/FilesystemStreamProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

use const SEEK_SET;

/**
* @psalm-suppress MixedInferredReturnType, MixedReturnStatement
*/
final class FilesystemStreamProxy implements StreamWrapperInterface
{
public static bool $registered = false;
Expand Down
18 changes: 15 additions & 3 deletions src/Collector/Stream/HttpStreamCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@
use Yiisoft\Yii\Debug\Collector\CollectorTrait;
use Yiisoft\Yii\Debug\Collector\SummaryCollectorInterface;

use function count;

final class HttpStreamCollector implements SummaryCollectorInterface
{
use CollectorTrait;

public function __construct(
/**
* @var string[]
*/
private readonly array $ignoredPathPatterns = [],
/**
* @var string[]
*/
private readonly array $ignoredClasses = [],
/**
* @var string[]
*/
private readonly array $ignoredUrls = []
) {
}

/**
* @psalm-var array<string, list<array{uri: string, args: array}>>
*/
private array $requests = [];

public function getCollected(): array
Expand Down Expand Up @@ -76,9 +90,7 @@ public function getSummary(): array
'http_stream' => array_merge(
...array_map(
fn (string $operation) => [
$operation => is_countable($this->requests[$operation]) ? count(
$this->requests[$operation]
) : 0,
$operation => count($this->requests[$operation]),
],
array_keys($this->requests)
)
Expand Down

0 comments on commit 8d3dd49

Please sign in to comment.