From 7e69a757d8078e8f57e7a9f2719b41e03fcf422f Mon Sep 17 00:00:00 2001 From: phpstan-bot Date: Thu, 19 Feb 2026 11:57:24 +0000 Subject: [PATCH] Document missing features in README Add descriptions for features that exist in src/ but were not listed in the README feature list: - Entity relation type validation (EntityRelationRule) - Final entity class detection (EntityNotFinalRule) - Final entity constructor detection (EntityConstructorNotFinalRule) - Mapping configuration error detection (EntityMappingExceptionRule) - Doctrine proxy class name prohibition - EntityManager::flush() throw type inference - Dead code detection integration for entity properties - Gedmo doctrine-extensions support - Collection::first()/last() type narrowing via isEmpty() Co-Authored-By: Claude Opus 4.6 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index c8a587b1..e4e69ad9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,16 @@ This extension provides following features: * Adds missing `matching` method on `Doctrine\Common\Collections\Collection`. This can be turned off by setting `parameters.doctrine.allCollectionsSelectable` to `false`. * Also supports Doctrine ODM. * Analysis of discrepancies between entity column types and property field types. This can be relaxed with the `allowNullablePropertyForRequiredField: true` setting. +* Analysis of discrepancies between entity relation types and property field types (to-one, to-many). * Provides return type for `Doctrine\ORM\Query::getResult`, `getOneOrNullResult`, `getSingleResult`, `toIterable` and `execute` in `HYDRATE_OBJECT` mode (see below). +* Reports `final` entity classes that can cause problems with Doctrine proxy generation (allowed when native lazy objects are enabled). +* Reports `final` entity constructors that can cause problems with Doctrine proxy generation. +* Detects Doctrine mapping configuration errors (annotation/attribute parsing issues). +* Forbids direct use of Doctrine proxy class names. +* Provides precise throw types for `EntityManager::flush()` (`ORMException`, `UniqueConstraintViolationException`). +* Integrates with PHPStan dead code detection — entity properties are not reported as unused. Recognizes generated identifiers, version fields, and read-only entities as always written. +* Supports [Gedmo doctrine-extensions](https://github.com/doctrine-extensions/DoctrineExtensions) — properties managed by Gedmo annotations/attributes (e.g. `Timestampable`, `Blameable`, `Slug`) are recognized for dead code detection. +* Narrows `Collection::first()` and `Collection::last()` return types from `T|false` to `T` when `isEmpty()` is `false`. ## Installation