bearsunday /
BEAR.QueryRepository
| 1 | <?php |
||||
| 2 | |||||
| 3 | declare(strict_types=1); |
||||
| 4 | |||||
| 5 | namespace BEAR\QueryRepository; |
||||
| 6 | |||||
| 7 | use Override; |
||||
| 8 | use Stringable; |
||||
| 9 | |||||
| 10 | use function implode; |
||||
| 11 | use function is_array; |
||||
| 12 | use function vsprintf; |
||||
| 13 | |||||
| 14 | use const PHP_EOL; |
||||
| 15 | |||||
| 16 | final class RepositoryLogger implements RepositoryLoggerInterface, Stringable |
||||
| 17 | { |
||||
| 18 | /** @var list<string> */ |
||||
|
0 ignored issues
–
show
|
|||||
| 19 | private array $logs = []; |
||||
| 20 | |||||
| 21 | /** |
||||
| 22 | * {@inheritDoc} |
||||
| 23 | */ |
||||
| 24 | #[Override] |
||||
| 25 | public function log(string $template, ...$values): void |
||||
| 26 | { |
||||
| 27 | /** @var bool|float|int|string|list<string>|null $value */ |
||||
| 28 | foreach ($values as &$value) { |
||||
| 29 | if (is_array($value)) { |
||||
| 30 | $value = $value !== [] ? implode(' ', $value) : ''; |
||||
| 31 | } |
||||
| 32 | } |
||||
| 33 | |||||
| 34 | unset($value); |
||||
| 35 | /** @var list<string> $values */ |
||||
| 36 | $msg = vsprintf($template, $values); |
||||
|
0 ignored issues
–
show
$values of type BEAR\QueryRepository\list is incompatible with the type array expected by parameter $values of vsprintf().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 37 | |||||
| 38 | $this->logs[] = $msg; |
||||
| 39 | } |
||||
| 40 | |||||
| 41 | #[Override] |
||||
| 42 | public function __toString(): string |
||||
| 43 | { |
||||
| 44 | return implode(PHP_EOL, $this->logs); |
||||
| 45 | } |
||||
| 46 | } |
||||
| 47 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths