Ignore code paths from code coverage that are only executed in edge cases

This commit is contained in:
Sebastian Bergmann 2024-06-21 07:20:48 +02:00
parent d50565cbe3
commit 119dedae41
No known key found for this signature in database
GPG Key ID: 4AA394086372C20A
1 changed files with 4 additions and 0 deletions

View File

@ -133,7 +133,9 @@ final readonly class Exporter
if ($this->canBeReflected($value)) {
$numberOfProperties = count((new ReflectionObject($value))->getProperties());
} else {
// @codeCoverageIgnoreStart
$numberOfProperties = count($this->toArray($value));
// @codeCoverageIgnoreEnd
}
return sprintf(
@ -403,7 +405,9 @@ final readonly class Exporter
{
/** @psalm-suppress UndefinedClass */
if ($object instanceof Message) {
// @codeCoverageIgnoreStart
return false;
// @codeCoverageIgnoreEnd
}
return true;