Issues (60)

src/RepositoryLogger.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\QueryRepository;
6
7
use Override;
8
use Stringable;
9
10
use function array_map;
11
use function implode;
12
use function json_encode;
13
14
use const JSON_UNESCAPED_SLASHES;
15
use const PHP_EOL;
16
17
final class RepositoryLogger implements RepositoryLoggerInterface, Stringable
18
{
19
    /** @var list<array<string, mixed>> */
0 ignored issues
show
The type BEAR\QueryRepository\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
    private array $logs = [];
21
22
    /**
23
     * {@inheritDoc}
24
     */
25
    #[Override]
26
    public function log(string $operation, array $context = []): void
27
    {
28
        $this->logs[] = ['op' => $operation, ...$context];
29
    }
30
31
    #[Override]
32
    public function __toString(): string
33
    {
34
        return implode(PHP_EOL, array_map(
35
            static fn (array $log): string => (string) json_encode($log, JSON_UNESCAPED_SLASHES),
36
            $this->logs,
37
        ));
38
    }
39
}
40