LdapTools\Operation\AuthenticationOperation::getArguments PHP Method

getArguments() public method

public getArguments ( )
    public function getArguments()
    {
        $this->validateArguments();
        return [$this->properties['username'], $this->properties['password'], $this->properties['isAnonymousBind'], $this->server];
    }

Usage Example

 /**
  * Attempts to connect with the given credentials and returns the response.
  *
  * @param AuthenticationOperation $operation
  * @return AuthenticationResponse
  */
 protected function getAuthenticationResponse(AuthenticationOperation $operation)
 {
     $authenticated = false;
     $errorMessage = null;
     $errorCode = null;
     // Only catch a bind failure. Let the others through, as it's probably a sign of other issues.
     try {
         $authenticated = (bool) $this->connection->close()->connect(...$operation->getArguments());
     } catch (LdapBindException $e) {
         $errorMessage = $this->connection->getLastError();
         $errorCode = $this->connection->getExtendedErrorNumber();
     }
     return new AuthenticationResponse($authenticated, $errorMessage, $errorCode);
 }