PHPackages                             nighten/doctrine-check - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. nighten/doctrine-check

ActiveLibrary[Database &amp; ORM](/categories/database)

nighten/doctrine-check
======================

Provides check for doctrine type mapping

0.7.0(1y ago)1627↓93.3%MITPHPPHP &gt;=8.1

Since Jun 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nighten/doctrine-check)[ Packagist](https://packagist.org/packages/nighten/doctrine-check)[ RSS](/packages/nighten-doctrine-check/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (4)Dependencies (6)Versions (8)Used By (0)

Doctrine check
==============

[](#doctrine-check)

Tool for check doctrine entity field mapping with php types.

Install
-------

[](#install)

```
composer require nighten/doctrine-check --dev
```

Running
-------

[](#running)

Create a `doctrine-check-config.php` in your root directory and modify:

Need to add doctrine object manager to config. Example for Symfony project:

```
use App\Kernel;
use Nighten\DoctrineCheck\Config\DoctrineCheckConfig;
use Symfony\Component\Dotenv\Dotenv;

require __DIR__ . '/vendor/autoload.php';

return function (DoctrineCheckConfig $config): void {
    (new Dotenv())->bootEnv(__DIR__ . '/.env');
    $kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
    $kernel->boot();

    $config->addObjectManager($kernel->getContainer()->get('doctrine')->getManager());
};
```

Then run check:

```
vendor/bin/doctrine-check types
```

The list of checks:
-------------------

[](#the-list-of-checks)

#### Simple types such as int, string, bool, datetime and so on. Check match type and nullable

[](#simple-types-such-as-int-string-bool-datetime-and-so-on-check-match-type-and-nullable)

Example:

```
#[ORM\Column(type: 'string', nullable: true)]
private ?string $code;

#[ORM\Column(type: 'integer', nullable: false, enumType: Type::class)]
private Type $type;

#[ORM\Column(type: 'boolean', nullable: false)]
private bool $deleted = false;

#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private ?DateTimeImmutable $updatedAt = null;
```

#### Association mapping ManyToOne:

[](#association-mapping-manytoone)

Example:

```
#[
    ORM\ManyToOne(targetEntity: User::class),
    ORM\JoinColumn(nullable: false),
]
private User $user;
```

#### Embedded mapping:

[](#embedded-mapping)

Types and nulls in the embeddable class are checked.

Types and null are checked in the main class

Example:

```
#[Embeddable]
class Address
{
    #[ORM\Column(type: 'string', nullable: true)]
    private ?string $code;
}

class User
{
    #[Embedded(class: Address::class)]
    private Address $address;
    ...
}
```

Configuration
-------------

[](#configuration)

### Add additional type mappings:

[](#add-additional-type-mappings)

```
use Symfony\Component\Uid\UuidV1;
use Symfony\Component\Uid\UuidV4;
use Symfony\Component\Uid\UuidV7;

//...

return function (DoctrineCheckConfig $config): void {
    //...
    $config->addTypeMapping('uuid', UuidV1::class);
    $config->addTypeMapping('uuid', UuidV4::class);
    $config->addTypeMapping('uuid', UuidV7::class);
};
```

### Add specific entity classes:

[](#add-specific-entity-classes)

The checker will check only the specified classes

```
use App\Entity\EntityClass;
use Nighten\DoctrineCheck\Type;

//...

return function (DoctrineCheckConfig $config): void {
    //...
    $config->addEntityClass(EntityClass::class);
};
```

### Ignore some entity classes:

[](#ignore-some-entity-classes)

The checker will check all classes except those specified

```
use App\Entity\EntityClass;
use Nighten\DoctrineCheck\Type;

//...

return function (DoctrineCheckConfig $config): void {
    //...
    $config->addExcludedEntityClasses(EntityClass::class);
};
```

### Add error ignores:

[](#add-error-ignores)

The checker will skip the specified errors

```
use App\Entity\EntityClass;
use Nighten\DoctrineCheck\Type;

//...

return function (DoctrineCheckConfig $config): void {
    //...
    $config->addIgnore(EntityClass::class, 'name', ErrorType::TYPE_WRONG_NULLABLE);
};
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Recently: every ~53 days

Total

7

Last Release

532d ago

PHP version history (2 changes)0.1.0PHP &gt;=8.0

0.4.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b742e20ea9cffbf3dedfd6cb7f28f5a13f8ce3c4d877a1383bed5030009a2c5d?d=identicon)[nighten](/maintainers/nighten)

---

Top Contributors

[![nighten](https://avatars.githubusercontent.com/u/7446731?v=4)](https://github.com/nighten "nighten (29 commits)")

---

Tags

devstatic analysisdebuginspectiondoctrine

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nighten-doctrine-check/health.svg)

```
[![Health](https://phpackages.com/badges/nighten-doctrine-check/health.svg)](https://phpackages.com/packages/nighten-doctrine-check)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[jawira/doctrine-diagram-bundle

📐 Symfony Bundle to generate database diagrams

81104.9k9](/packages/jawira-doctrine-diagram-bundle)[forumify/forumify-platform

122.0k14](/packages/forumify-forumify-platform)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
