• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mattiabasone / fixed-width / 16224265831

11 Jul 2025 03:55PM UTC coverage: 98.438% (-1.6%) from 100.0%
16224265831

push

github

mattiabasone
update test matrix

63 of 64 relevant lines covered (98.44%)

4.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/src/Serializer/ObjectPropertyData.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace MattiaBasone\FixedWidth\Serializer;
6

7
use MattiaBasone\FixedWidth\FixedWidth;
8
use MattiaBasone\FixedWidth\FixedWidthProperty;
9

10
/**
11
 * @internal
12
 */
13
final readonly class ObjectPropertyData
14
{
15
    public function __construct(
16
        public \ReflectionProperty $reflectionProperty,
17
        public FixedWidthProperty $attribute
18
    ) {
19
    }
2✔
20

21
    public function name(): string
22
    {
23
        return $this->reflectionProperty->getName();
4✔
24
    }
25

26
    public function type(): string
27
    {
28
        $type = $this->reflectionProperty->getType();
4✔
29
        return match ($type::class) {
4✔
30
            \ReflectionNamedType::class => $type->getName(),
4✔
31
            \ReflectionIntersectionType::class => throw new \LogicException("{$this->name()} invalid type - Intersection type is not supported"),
×
32
            \ReflectionUnionType::class => throw new \LogicException("{$this->name()} invalid type - Union type is not supported"),
4✔
33
        };
4✔
34
    }
35

36
    public function valueForEntity(FixedWidth $object): mixed
37
    {
38
        return $this->reflectionProperty->getValue($object);
4✔
39
    }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc