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

api-platform / core / 20847864477

09 Jan 2026 09:47AM UTC coverage: 29.1% (+0.005%) from 29.095%
20847864477

Pull #7649

github

web-flow
Merge b342dd5db into d640d106b
Pull Request #7649: feat(validator): uuid/ulid parameter validation

0 of 4 new or added lines in 1 file covered. (0.0%)

15050 existing lines in 491 files now uncovered.

16996 of 58406 relevant lines covered (29.1%)

81.8 hits per line

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

27.27
/src/State/ObjectMapper/ObjectMapper.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\State\ObjectMapper;
15

16
use ApiPlatform\Metadata\Exception\RuntimeException;
17
use Symfony\Component\ObjectMapper\ObjectMapperAwareInterface;
18
use Symfony\Component\ObjectMapper\ObjectMapperInterface;
19

UNCOV
20
if (false === class_exists(ObjectMapperAwareInterface::class)) {
2✔
21
    final class ObjectMapper implements ObjectMapperInterface
22
    {
23
        public function __construct(private ObjectMapperInterface $decorated)
24
        {
UNCOV
25
        }
2,398✔
26

27
        public function map(object $source, object|string|null $target = null): object
28
        {
UNCOV
29
            return $this->decorated->map($source, $target);
18✔
30
        }
31
    }
32
} else {
33
    final class ObjectMapper implements ObjectMapperInterface, ObjectMapperAwareInterface
34
    {
35
        public function __construct(private ObjectMapperInterface $decorated)
36
        {
37
            if ($this->decorated instanceof ObjectMapperAwareInterface) {
×
38
                $this->decorated = $this->decorated->withObjectMapper($this);
×
39
            }
40
        }
41

42
        public function map(object $source, object|string|null $target = null): object
43
        {
44
            return $this->decorated->map($source, $target);
×
45
        }
46

47
        public function withObjectMapper(ObjectMapperInterface $objectMapper): static
48
        {
49
            $s = clone $this;
×
50

51
            if (!$s->decorated instanceof ObjectMapperAwareInterface) {
×
52
                throw new RuntimeException(\sprintf('Given object mapper "%s" does not implements %s.', get_debug_type($this->decorated), ObjectMapperAwareInterface::class));
×
53
            }
54

55
            $s->decorated->withObjectMapper($objectMapper);
×
56

57
            return $s;
×
58
        }
59
    }
60
}
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

© 2026 Coveralls, Inc