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

[5.6] make model factory after method signatures more consistent #23676

Conversation

unstoppablecarl
Copy link
Contributor

This does some "breaking" cleanup for #23551

@taylorotwell taylorotwell merged commit 3fd1b23 into laravel:5.6 Mar 23, 2018
* @return $this
*/
public function afterMaking($class, $callback)
public function afterMaking($class, callable $callback, $name = 'default')
Copy link
Member

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)
Copy link
Member

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')
Copy link
Member

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)
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, right, good.

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.

None yet

4 participants