docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 123 forks source link

Example use of LoginInformation fails on Count() #71

Closed plweller3 closed 4 years ago

plweller3 commented 5 years ago

While the library itself seems to work with PHP 7.2, the use of count() on an instantiation of LoginInformation fails. The fix is to implement the Countable interface on LoginInformation:

      class LoginInformation implements ArrayAccess, \Countable

And then add a count method in the class to access container:

      public function count() 
     { 
            return count($this->container); 
      }    
LarryKlugerDS commented 5 years ago

Hi @plweller3,

Did you know that the LoginInformation SDK method cannot be used with OAuth authentication methods? And that only OAuth authentication should be used for new integrations with DocuSign?

Unfortunately the LoginInformation method is poorly named.

We have PHP code examples for both OAuth Authorization Code Grant (when the user is present) and OAuth JWT Grant.

Both of those examples also show how to use the OAuth::getUserInfo method instead of the obsolete LoginInformation method.

Thanks, Larry

LarryKlugerDS commented 5 years ago

I have created internal ticket DCM-3190 for this request.

LarryKlugerDS commented 4 years ago

Since LoginInformation (and the related legacy authentication techniques) have been deprecated for a couple of years now, I'm closing this issue as won't fix.