Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

[RFC] Method overloading #10

Open
olivernybroe opened this issue Sep 15, 2019 · 1 comment
Open

[RFC] Method overloading #10

olivernybroe opened this issue Sep 15, 2019 · 1 comment

Comments

@olivernybroe
Copy link

Basically the support for having multiple methods named the same but with different parameters.
For example, this would be really helpful in the Laravel Query builder, where if we look at the where method for example, it is full of if statements to call the correct method. If we had method overloading, this would simply be multiple methods, taking the correct argument in each of the methods.
https://github.com/laravel/framework/blob/2906b572aa83ff46b8ad57093dd0e859c0ff783f/src/Illuminate/Database/Query/Builder.php#L487-L548

@stancl
Copy link

stancl commented Sep 15, 2019

+1, pattern matching/method overloading makes some code so much more elegant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants