-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.6] make model factory after method signatures more consistent #23676
[5.6] make model factory after method signatures more consistent #23676
Conversation
* @return $this | ||
*/ | ||
public function afterMaking($class, $callback) | ||
public function afterMaking($class, callable $callback, $name = 'default') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this extra type from the definition. It's a breaking change to the signature.
@@ -133,23 +134,22 @@ public function afterMaking($class, $callback) | |||
* @param callable $callback | |||
* @return $this | |||
*/ | |||
public function afterMakingState($class, $state, $callback) | |||
public function afterMakingState($class, $state, callable $callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
* @return $this | ||
*/ | ||
public function afterCreating($class, $callback) | ||
public function afterCreating($class, callable $callback, $name = 'default') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
etc
@@ -162,11 +162,9 @@ public function afterCreating($class, $callback) | |||
* @param callable $callback | |||
* @return $this | |||
*/ | |||
public function afterCreatingState($class, $state, $callback) | |||
public function afterCreatingState($class, $state, callable $callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to add this, please do it on master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did and @taylorotwell said to put it here. #23670
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feature has not been tagged yet so no worries about breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, good.
This does some "breaking" cleanup for #23551