laravel-friendships
laravel-friendships copied to clipboard
[WIP] Add deprecate notes
Improve display of deprecated errors:
- [x] Unique error messages
- [x] report after tests report
- [x] report with Red BG
Method to deprecate:
- [x] friends()
- [x] getMutualFriends()
- [x] getFriends()
- [x] getFriendsOfFriends()
- [x] ...
Fix all deprecated errors for the build:
- [x] Remove use of deprecated methods in src
- [x] Use the group annotation in test classes
Add more details about new methods in deprecated notes:
- [ ]
@deprecatedcomments - [ ] E_USER_DEPRECATED error messages
- [ ] in a changelog file
New methods (lazy getters = return a collection of model, a model instance or a integer for count method):
FriendRequests
- [ ] Add deprecated note migration
getFriendshipbecomegetFriendRequest(only 1 way ?) - [ ] Add deprecated note migration
getAllFriendshipsbecomegetFriendRequests(only 1 way ?) - [ ] Add deprecated note migration
getPendingFriendshipsbecomegetPendingFriendRequests(only 1 way ?) - [ ] Add deprecated note migration
getAcceptedFriendshipsbecomegetAcceptedFriendRequests(only 1 way ?) - [ ] Add deprecated note migration
getDeniedFriendshipsbecomegetDeniedFriendRequests(only 1 way ?) - [ ] Add deprecated note migration
getBlockedFriendshipsbecomegetBlockedFriendRequests(only 1 way ?) - [ ] Remove deprecated note
getFriends
Model (ex: User)
- [x] Remove deprecated note
getMutualFriends - [x] Remove deprecated note
getMutualFriendsCount - [x] Remove deprecated note
getFriendsOfFriends - [x] Remove deprecated note
getFriendsCount
@stephane-monnot I believe we should keep getSOMEfriendships and getSOMEfriends methods just to exist and reference them in a Lazy Getters section in the readme. What do you think?
Yes, but maybe rename getSOMEfriendships to getSOMEfriendRequests.
@hootlex Could you valid the roadmap ("new method" checklist above) for deprecated notes and answer the "only 1 way" questions please ?
By keeping the current getSOMEfriendships method names, we achieve a small backward compatibility. So, I think it's better to keep them.
About '1 way', I agree. They should work how they used to work to avoid confusion.
Yes, but I'm a little confused about friendships and friends.
Keep the getSOMEFriendRequests if you prefer them. The difference is small.
@stephane-monnot let me know when this is ready to merge.
I have to implement new methods because we can't mark methods as deprecated without alternatives. I will try to finish this week.
@hootlex Could you work on this PR and :
- Implement new renamed methods
- Add details on deprecated messages (You should use XXXX instead)
I can work a little on this PR this month, but I don't have time as before, because I'm teaching in a school.
@stephane-monnot I am very happy to hear that. 😄 I don't have a lot of time now too because I am working on my Vue.js book.
Though, I expect to start working on this upgrade next month. Also, I will create a Gitter channel to be able to discuss about the package. Thanks for the work you've done so far.