Skip to content

Conversation

@come-nc
Copy link
Contributor

@come-nc come-nc commented Jun 16, 2025

Summary

It appears that ReflectionClass does not appear in the trace in the end, so we need to match the closure to be sure we’re fine.
I use preg_match so that it does not break when the line number of the closure changes.

Checklist

…t direct constructor call

Signed-off-by: Côme Chilliet <[email protected]>
@come-nc come-nc added this to the Nextcloud 32 milestone Jun 16, 2025
@come-nc come-nc requested review from kesselb and susnux June 16, 2025 10:03
@come-nc come-nc self-assigned this Jun 16, 2025
@come-nc come-nc added the 3. to review Waiting for reviews label Jun 16, 2025
@come-nc come-nc requested a review from a team as a code owner June 16, 2025 10:03
@come-nc come-nc requested review from nfebe, skjnldsv and sorbaugh and removed request for a team June 16, 2025 10:03
$step['class'] === \ReflectionClass::class &&
$step['function'] === 'initializeLazyObject' &&
$step['class'] === SimpleContainer::class &&
preg_match('/{closure:OC\\\\AppFramework\\\\Utility\\\\SimpleContainer::buildClass\\(\\):\\d+}/', $step['function']) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Performance wise maybe str_starts_with until the end of buildClass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Performance in debug mode is not a concern 🤷
But yeah, that would work too, I do not really care which gets merged.

@come-nc come-nc enabled auto-merge June 16, 2025 16:03
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

👻

@come-nc come-nc merged commit 64208b6 into master Jun 16, 2025
204 of 206 checks passed
@come-nc come-nc deleted the fix/fix-warning-lazy-ghost-application branch June 16, 2025 17:16
@skjnldsv skjnldsv mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Warning with lazy objects and debug mode "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly"

4 participants