protected function validateUser(array $credentials, $id = null)
    {
        $instance = $this->createModel();

        $loginNames = $instance->getLoginNames();

        // We will simply parse credentials which checks logins and passwords
        list($logins, $password, $credentials) = $this->parseCredentials($credentials, $loginNames);

        if ($id === null) {
            if (empty($logins)) {
                throw new InvalidArgumentException('No [login] credential was passed.');
            }

            if (empty($password)) {
                throw new InvalidArgumentException('You have not passed a [password].');
            }
        }

        return true;
    }
protected function validateUser(array $credentials, $id = null)
    {
        $instance = $this->createModel();

        $loginNames = $instance->getLoginNames();

        // We will simply parse credentials which checks logins and passwords
        list($logins, $password, $credentials) = $this->parseCredentials($credentials, $loginNames);

        if ($id === null) {
            if (empty($logins)) {
                throw new InvalidArgumentException('No [login] credential was passed.');
            }

            if (empty($password)) {
                throw new InvalidArgumentException('You have not passed a [password].');
            }
        }

        return true;
    }
protected function validateUser ( array $ credentials , $ id = null ) { $ instance = $ this -> createModel ( ) ; $ loginNames = $ instance -> getLoginNames ( ) ; // We will simply parse credentials which checks logins and passwords list ( $ logins , $ password , $ credentials ) = $ this -> parseCredentials ( $ credentials , $ loginNames ) ; if ( $ id === null ) { if ( empty ( $ logins ) ) { throw new InvalidArgumentException ( 'No [login] credential was passed.' ) ; } if ( empty ( $ password ) ) { throw new InvalidArgumentException ( 'You have not passed a [password].' ) ; } } return true ; }
Validates the user.

@param  array  $credentials
@param  int  $id
@return bool
@throws \InvalidArgumentException
Validates the user .