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

Make firePostCreateHook() backwards compatability with all Laravel 5.6 #24916

Closed

Conversation

chrishalbert
Copy link

@chrishalbert chrishalbert commented Jul 20, 2018

The original MigrationCreator::firePostCreateHook() of laravel 5.6 did not receive a parameter. Since this method is protected, the intent I believe is to allow developers to extend that class and optionally override that method. However, by adding a parameter to the method signature, any subclass overriding that method would break.

Recently, an enhancement was added so that this method receives the table name (ref: #24621). This can be useful, however, as noted above, it is not backwards compatible.

To fix this, I'm assigning the $table as a variable of the instance during the create() method, which immediately calls the firePostCreateHook(). I'm passing $this->table to the callback rather so that the test in the pull request above still passes as well.

This is beneficial to developers that rely on the assumptions of the contribution guidelines. It provides assurance that using and extending laravel classes' newest minor versions will not inadvertently break their code. This is only a small benefit, but moreover, it does uphold the guidelines to ensure backwards compatibility.

@taylorotwell
Copy link
Member

No plans on merging this.

@chrishalbert
Copy link
Author

Thanks, @taylorotwell. Can you provide some constructive criticism on why? I'm assuming more weight is given to risk vs reward considerations rather than the dev standards. Let me know if I'm wrong on that assumption; I'd just like to make sure that any further PRs/issues offer substance. Thank you for the feedback.

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.

2 participants