laravel-friendships icon indicating copy to clipboard operation
laravel-friendships copied to clipboard

[WIP] Add deprecate notes

Open stephane-monnot opened this issue 9 years ago • 10 comments

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:

  • [ ] @deprecated comments
  • [ ] 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 getFriendship become getFriendRequest (only 1 way ?)
  • [ ] Add deprecated note migration getAllFriendships become getFriendRequests (only 1 way ?)
  • [ ] Add deprecated note migration getPendingFriendships become getPendingFriendRequests (only 1 way ?)
  • [ ] Add deprecated note migration getAcceptedFriendships become getAcceptedFriendRequests (only 1 way ?)
  • [ ] Add deprecated note migration getDeniedFriendships become getDeniedFriendRequests (only 1 way ?)
  • [ ] Add deprecated note migration getBlockedFriendships become getBlockedFriendRequests (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 avatar Aug 18 '16 13:08 stephane-monnot

@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?

hootlex avatar Aug 18 '16 21:08 hootlex

Yes, but maybe rename getSOMEfriendships to getSOMEfriendRequests.

stephane-monnot avatar Aug 19 '16 00:08 stephane-monnot

@hootlex Could you valid the roadmap ("new method" checklist above) for deprecated notes and answer the "only 1 way" questions please ?

stephane-monnot avatar Aug 19 '16 01:08 stephane-monnot

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.

hootlex avatar Aug 19 '16 02:08 hootlex

Yes, but I'm a little confused about friendships and friends.

stephane-monnot avatar Aug 19 '16 08:08 stephane-monnot

Keep the getSOMEFriendRequests if you prefer them. The difference is small.

hootlex avatar Aug 19 '16 11:08 hootlex

@stephane-monnot let me know when this is ready to merge.

hootlex avatar Aug 22 '16 13:08 hootlex

I have to implement new methods because we can't mark methods as deprecated without alternatives. I will try to finish this week.

stephane-monnot avatar Aug 22 '16 17:08 stephane-monnot

@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 avatar Oct 03 '16 12:10 stephane-monnot

@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.

hootlex avatar Oct 03 '16 19:10 hootlex