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

Clean up method receiver constructors #18

Merged
merged 2 commits into from
Feb 19, 2016
Merged

Conversation

deuill
Copy link
Owner

@deuill deuill commented Feb 19, 2016

This removes duplicate constructors for Context and Receiver method receivers, enforcing instantiation through the canonical Engine methods.

This removes the `NewReceiver` method and moves logic for the `Define`
method from the `Engine` method receiver to `Context`.

Moving the `Define` method was required due to a bug/feature where
destroying a `Context` before all defined Receivers have also been
destroyed causes memory errors. Tying method receiver definitions
to the `Context` lifecycle implicitly fixes this issue.

This approach, however, contains a possible flaw, since class names
in PHP are defined in the global scope (i.e. the `Engine`), and
destroying a defined `Receiver` also removes the class entry for that
name, supposedly across all running contexts.
@deuill deuill force-pushed the feature/dependency-cleanup branch from 2a410da to c1905f3 Compare February 19, 2016 21:57
deuill added a commit that referenced this pull request Feb 19, 2016
Clean up method receiver constructors
@deuill deuill merged commit 3eaec65 into master Feb 19, 2016
@deuill deuill deleted the feature/dependency-cleanup branch August 31, 2016 10:37
borancar pushed a commit to borancar/go-php that referenced this pull request Dec 1, 2019
Feature/resource group param

Approved-by: James Stow <james.stow@antstream.com>
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.

1 participant