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

tito10047 / type-safe-id-bundle / 23162475169

16 Mar 2026 07:39PM UTC coverage: 82.443% (+12.5%) from 69.912%
23162475169

push

github

tito10047
add TypeIdGenerator for custom ID generation and related integration tests

19 of 20 new or added lines in 4 files covered. (95.0%)

8 existing lines in 1 file now uncovered.

108 of 131 relevant lines covered (82.44%)

25.79 hits per line

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

66.67
/src/IdGenerator/TypeIdGenerator.php
1
<?php
2

3
namespace Tito10047\TypeSafeIdBundle\IdGenerator;
4

5
use Doctrine\ORM\EntityManager;
6
use Doctrine\ORM\EntityManagerInterface;
7
use Doctrine\ORM\Id\AbstractIdGenerator;
8
use Tito10047\TypeSafeIdBundle\GeneratableId;
9

10
final class TypeIdGenerator extends AbstractIdGenerator
11
{
12
    private string $typeClass;
13

14
    public function __construct(string $typeClass)
15
    {
16
        $this->typeClass = $typeClass;
24✔
17
    }
18

19
    /**
20
     * doctrine/orm < 2.11 BC layer.
21
     */
22
    public function generate(EntityManager $em, $entity): mixed
23
    {
NEW
24
        return $this->generateId($em, $entity);
×
25
    }
26

27
    public function generateId(EntityManagerInterface $em, $entity): GeneratableId
28
    {
29
        return $this->typeClass::new();
12✔
30
    }
31
}
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