Skip to content

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Oct 30, 2025

Native lazy objects don't need proxy classes. By deprecating interfaces and methods related to proxies, we can spot them more easily in integration and ensure we don't use them when native lazy objects are enabled.

private readonly string $defaultConnection,
private readonly string $defaultManager,
private readonly string $proxyInterfaceName,
private readonly string|null $proxyInterfaceName = null,
Copy link
Member Author

@GromNaN GromNaN Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*
* @phpstan-param class-string $className
* @phpstan-param CMTemplate $class
*/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is never used; last usage removed by

@derrabus derrabus requested a review from greg0ire October 30, 2025 15:00
@stof
Copy link
Member

stof commented Oct 30, 2025

Deprecating those seems too early when the package (and the object manager packages implementing the interface) still have actively maintained versions that support PHP 8.3 and older (and so cannot use native lazy objects unconditionally)

@stof
Copy link
Member

stof commented Oct 30, 2025

For reference, the ORM triggers its own deprecation warning about using proxies instead of native lazy objects only when running on PHP 8.4+

@GromNaN
Copy link
Member Author

GromNaN commented Oct 30, 2025

Deprecating those seems too early when the package (and the object manager packages implementing the interface) still have actively maintained versions that support PHP 8.3 and older (and so cannot use native lazy objects unconditionally)

That's what I think too. Deprecations are not triggered directly, but the autoloader will do it. It's mainly to identify classes and interfaces that should no longer be used when native lazy is enabled.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants