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

api-platform / core / 19237707235

10 Nov 2025 03:58PM UTC coverage: 0.0%. Remained the same
19237707235

Pull #7521

github

web-flow
Merge eb735f2a9 into 70611b397
Pull Request #7521: fix(state): create PUT has relation with lazy mapper

0 of 74 new or added lines in 7 files covered. (0.0%)

8 existing lines in 3 files now uncovered.

0 of 56739 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/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

20
final class ObjectMapper implements ObjectMapperInterface
21
{
22
    public function __construct(private ObjectMapperInterface $decorated)
23
    {
24
        if ($this->decorated instanceof ObjectMapperAwareInterface) {
×
25
            $this->decorated = $this->decorated->withObjectMapper($this);
×
26
        }
27
    }
28

29
    public function map(object $source, object|string|null $target = null): object
30
    {
NEW
31
        return $this->decorated->map($source, $target);
×
32
    }
33

34
    public function withObjectMapper(ObjectMapperInterface $objectMapper): static
35
    {
36
        if (!$this->decorated instanceof ObjectMapperAwareInterface) {
×
37
            throw new RuntimeException(\sprintf('Given object mapper "%s" does not implements %s.', get_debug_type($this->decorated), ObjectMapperAwareInterface::class));
×
38
        }
39

40
        $this->decorated->withObjectMapper($objectMapper);
×
41

42
        return $this;
×
43
    }
44
}
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