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

api-platform / core / 16598414478

29 Jul 2025 02:03PM UTC coverage: 22.182% (+0.2%) from 21.944%
16598414478

Pull #7319

github

web-flow
Merge 914d992b2 into d06b1a0a0
Pull Request #7319: feat(doctrine): improve http cache invalidation using the mapping

24 of 58 new or added lines in 3 files covered. (41.38%)

2 existing lines in 1 file now uncovered.

11645 of 52498 relevant lines covered (22.18%)

23.66 hits per line

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

0.0
/src/Symfony/Tests/Fixtures/MappedEntity.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\Symfony\Tests\Fixtures;
15

16
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\MappedResource;
17
use Doctrine\ORM\Mapping as ORM;
18
use Symfony\Component\ObjectMapper\Attribute\Map;
19

20
/**
21
 * MappedEntity to MappedResource.
22
 */
23
#[ORM\Entity]
24
#[Map(target: MappedResource::class)]
25
class MappedEntity
26
{
27
    #[ORM\Column(type: 'integer')]
28
    #[ORM\Id]
29
    #[ORM\GeneratedValue(strategy: 'AUTO')]
30
    private ?int $id = null;
31

32
    #[ORM\Column]
33
    #[Map(if: false)]
34
    private string $firstName;
35

36
    #[Map(target: 'username', transform: [self::class, 'toUsername'])]
37
    #[ORM\Column]
38
    private string $lastName;
39

40
    public static function toUsername($value, $object): string
41
    {
NEW
42
        return $object->getFirstName().' '.$object->getLastName();
×
43
    }
44

45
    public function getId(): ?int
46
    {
NEW
47
        return $this->id;
×
48
    }
49

50
    public function setLastName(string $name): void
51
    {
NEW
52
        $this->lastName = $name;
×
53
    }
54

55
    public function getLastName(): string
56
    {
NEW
57
        return $this->lastName;
×
58
    }
59

60
    public function setFirstName(string $name): void
61
    {
NEW
62
        $this->firstName = $name;
×
63
    }
64

65
    public function getFirstName(): string
66
    {
NEW
67
        return $this->firstName;
×
68
    }
69
}
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