Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ObjectManager::isUninitializedObject() #334

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ awareness about deprecated code.
- Use of our low-overhead runtime deprecation API, details:
https://github.com/doctrine/deprecations/

# Upgrade to 3.1
# Upgrade to 3.3

## Added method `Proxy::__setInitialized()`
## Added method `ObjectManager::isUninitializedObject()`

Classes implementing `Doctrine\Persistence\Proxy` should implement the new
Classes implementing `Doctrine\Persistence\ObjectManager` should implement the new
method. This method will be added to the interface in 4.0.

# Upgrade to 3.1

## Deprecated `RuntimePublicReflectionProperty`

Use `RuntimeReflectionProperty` instead.
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ parameters:
count: 1
path: src/Persistence/Reflection/EnumReflectionProperty.php

-
message: "#^Call to function method_exists\\(\\) with Doctrine\\\\Persistence\\\\Proxy and '__setInitialized' will always evaluate to true\\.$#"
count: 1
path: src/Persistence/Reflection/RuntimeReflectionProperty.php

-
message: "#^Variable property access on \\$this\\(Doctrine\\\\Persistence\\\\Reflection\\\\TypedNoDefaultRuntimePublicReflectionProperty\\)\\.$#"
count: 1
Expand Down
2 changes: 2 additions & 0 deletions src/Persistence/ObjectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Contract for a Doctrine persistence layer ObjectManager class to implement.
*
* @method bool isUninitializedObject(mixed $value) Implementing this method will be mandatory in version 4.
*/
interface ObjectManager
{
Expand Down
1 change: 0 additions & 1 deletion src/Persistence/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* Interface for proxy classes.
*
* @template T of object
* @method void __setInitialized(bool $initialized) Implementing this method will be mandatory in version 4.
*/
interface Proxy
{
Expand Down