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

WIP: Define a Methods trait #18

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

Conversation

stevegrunwell
Copy link
Member

This trait exposes three methods:

  1. defineMethod(string $class, string $name, \Closure $closure, string $visibility = 'public', bool $static = false): self
  2. redefineMethod(string $class, string $name, ?\Closure $closure, ?string $visibility = null, ?bool $static = null): self
  3. deleteMethod(string $class, string $name): self

Fixes #12.

To-do:

  • Document where this trait should actually be used and make it very clear that it should be a last resort.

@stevegrunwell stevegrunwell added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 24, 2020
@stevegrunwell stevegrunwell added this to the Version 0.3.0 milestone Nov 24, 2020
@stevegrunwell stevegrunwell self-assigned this Nov 24, 2020
This trait exposes three methods:

1. `defineMethod(string $class, string $name, \Closure $closure, string $visibility = 'public', bool $static = false): self`
2. `redefineMethod(string $class, string $name, ?\Closure $closure, ?string $visibility = null, ?bool $static = null): self`
3. `deleteMethod(string $class, string $name): self`

Refs #12.
@stevegrunwell stevegrunwell marked this pull request as draft November 24, 2020 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let methods be redefined
1 participant