IsraelOrtuno / pipedrive

Complete Pipedrive API client for PHP
MIT License
166 stars 58 forks source link

findByName() Method Should Not be Globally Deprecated #94

Closed zienowicz closed 3 years ago

zienowicz commented 3 years ago

Devio\Pipedrive\Resources\Traits::findByName() has been marked as deprecated. It's a wrapper for Pipedrive's /find endpoint, which has been deprecated in favor of /search—but not for all resources. In particular, /users/find has not been deprecated, and the /users/search endpoint has not been implemented. See the Pipedrive API Changelog for the six endpoints that are affected: https://pipedrive.readme.io/docs/changelog#removal-of-the-/find-/searchresults-and-/searchresults/field-endpoints-replaced-by-6-new-endpoints

The trait is used mostly by classes where findByName() has been deprecated, so perhaps a simple solution would be to remove the trait from Devio\Pipedrive\Resources\Users and implement findByName() (maybe rename it "find()" to prevent confusion) as a method directly in the class.

IsraelOrtuno commented 3 years ago

That would be a solution, but not sure about renaming it to "find" since it may be a breaking change, maybe as an alias. Could you submit a PR?