Skip to content

Deprecate ClassMetadataFactory::hasMetadataFor() - #533

Merged
greg0ire merged 1 commit into
doctrine:4.3.xfrom
mpdude:deprecate-hasmetadatafor
Nov 8, 2026
Merged

greg0ire merged 1 commit into
doctrine:4.3.xfrom
mpdude:deprecate-hasmetadatafor

Conversation

@mpdude

@mpdude mpdude commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

This method exposes an implementation detail: whether a class's metadata has already been lazily loaded from the mapping driver in the current process.

That detail doesn't make sense for every ClassMetadataFactory implementation. A factory backed by a precompiled/snapshot-based metadata source, as explored in doctrine/orm#12760, has no notion of "not yet loaded" to report.

The ORM can live without this method on the interface. As far as I can tell, the ODM does not currently use it either.

Closes #532

@mpdude
mpdude force-pushed the deprecate-hasmetadatafor branch from cfa19d5 to a7cd236 Compare November 6, 2026 22:24
@mpdude
mpdude force-pushed the deprecate-hasmetadatafor branch from a7cd236 to 0edbdb8 Compare November 6, 2026 22:28
@greg0ire greg0ire added this to the 4.3.0 milestone Nov 8, 2026
@greg0ire
greg0ire merged commit 7869a40 into doctrine:4.3.x Nov 8, 2026
12 checks passed
@greg0ire

greg0ire commented Nov 8, 2026

Copy link
Copy Markdown
Member

Thanks @mpdude !

ondrejmirtes added a commit to phpstan/phpstan that referenced this pull request Nov 9, 2026
phpunit and drupal: phpstan/phpstan-src#7006 now runs restricted-usage
checks on nullable receivers, so calls on ?Driver and
\JsonSchema\Validator|null are reported.

symfony: doctrine/persistence 4.3.x-dev deprecated
ClassMetadataFactory::hasMetadataFor() (doctrine/persistence#533).

Amp-Thread-ID: https://ampcode.com/threads/T-01a19770-5331-74b2-963f-e324ae0f7635
@GromNaN

GromNaN commented Nov 12, 2026

Copy link
Copy Markdown
Member

Thanks, nothing to change in doctrine/mongodb-odm: it does not call hasMetadataFor().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants