-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Remove classes from aliases list #2980
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
Remove classes from aliases list #2980
Conversation
👍 |
Big 👍 from me. I always use the full class names in my code anyway. |
:( this going to make evaluating badly written package slightly harder for me. |
Mior, can you go into more detail on this?
|
@driesvints it was a sarcastic comment. I do actually welcome this, and if anyone insist to have it he/she still are able to do so by editing the config, it just not bundle in by default. Package that have |
@crynobone I completely agree. I see such use statements in packages all the time, and the really bug me. |
Yes I agree, +1 for making my package less relevant ;) Especially because you can't really do anything with traits in the helper, and they are a bit weird to class alias. |
One example that I personally experience recently, we had one proof of concept app using CodeIgniter with multiple illuminate components which was working nicely for us. However we need to include a Barcode integration to it and we did find one laravel package that allow that, normally you can just manually load the package by mimicking the service provider but in this case the package include |
+1 from me, too.
|
Eloquent and Seeder were used to extend from which is a bad practice. The SoftDeletingTrait should be imported just like the UserTrait and the RemindableTrait. Str was also removed because it's just a shortcut for the namespace. People can always re-add it if they like. I wasn't entirely sure what FormRequest was doing here but I have a feeling it's going to be used for the same reasons as one of the above classes. So I removed it as well.
@crynobone ok, lol sorry. Didn't get that. I've now removed the I've also removed the FormRequest class. Taylor: is that ok? Updated commit message:
|
👍 |
1 similar comment
👍 |
…iases Remove classes from aliases list
Eloquent and Seeder were used to extend from. Extending from aliases is a bad practice because it's hard to mock an none existing object when testing (see urls below) and you can't get any autocomplete from then in your IDE's. This lets us being less reliant on packages like this one: https://github.com/barryvdh/laravel-ide-helper
Not that I'm saying it's a bad package. Just saying it's better to be less reliant.
The SoftDeletingTrait should be imported just like the UserTrait and the RemindableTrait. Same reasons as above.
PS: It's the same reason why I'd like to remove Str from this list. I'm not entirely sure atm what
FormRequest
is going to be used for but if it's in the same context as Eloquent and Seeder then it should be removed as well imo.