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

feat: provide current factory to after/before hooks #738

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

nikophil
Copy link
Member

@nikophil nikophil commented Dec 10, 2024

fixes #677

@nikophil nikophil requested a review from kbond December 10, 2024 17:32
// $attributes is what will be used to instantiate the object, manipulate as required
// $class is the class of the object being instantiated
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why we're passing the $class here 🤔

/**
* @author Nicolas Philippe <[email protected]>
*/
final class FactoryWithHooksInInitializeTest extends KernelTestCase
Copy link
Member Author

Choose a reason for hiding this comment

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

I did not find any other class to put this test (we need a KernelTestCase, so that ->isPersisting() can return true)

@nikophil nikophil changed the title feat: provide current factory to hook feat: provide current factory to after/before hooks Dec 10, 2024
@nikophil nikophil force-pushed the feat/provide-factory-to-hooks branch from 86e6c74 to 6f92f5d Compare December 11, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Cannot access actual factory instance in after/before Instantiate hooks
1 participant