original_string: public function isValid($value, array $context = null)
      {
          $context = (array) $context;
  
           if (!array_key_exists($this->identity, $context) || empty($context[$this->identity])) {
  //             $this->error(self::IDENTITY_EMPTY);
               return false;
           }
          
           if (!array_key_exists($this->credential, $context) || empty($context[$this->credential])) {
  //             $this->error(self::CREDENTIAL_EMPTY);
               return false;
           }
          
          $authAdapter = $this->auth->getAdapter();
          $authAdapter->setIdentity($context[$this->identity]);
          $authAdapter->setCredential($context[$this->credential]);
          
          $result = $this->authResult = $this->auth->authenticate();
          
          if (!$result->isValid()) {
              $this->error($result->getCode());
              return false;
          }
          
          return true;
      }
code: public function isValid($value, array $context = null)
      {
          $context = (array) $context;
  
           if (!array_key_exists($this->identity, $context) || empty($context[$this->identity])) {
  //             $this->error(self::IDENTITY_EMPTY);
               return false;
           }
          
           if (!array_key_exists($this->credential, $context) || empty($context[$this->credential])) {
  //             $this->error(self::CREDENTIAL_EMPTY);
               return false;
           }
          
          $authAdapter = $this->auth->getAdapter();
          $authAdapter->setIdentity($context[$this->identity]);
          $authAdapter->setCredential($context[$this->credential]);
          
          $result = $this->authResult = $this->auth->authenticate();
          
          if (!$result->isValid()) {
              $this->error($result->getCode());
              return false;
          }
          
          return true;
      }
code_tokens: public function isValid ( $ value , array $ context = null ) { $ context = ( array ) $ context ; if ( ! array_key_exists ( $ this -> identity , $ context ) || empty ( $ context [ $ this -> identity ] ) ) { //             $this->error(self::IDENTITY_EMPTY); return false ; } if ( ! array_key_exists ( $ this -> credential , $ context ) || empty ( $ context [ $ this -> credential ] ) ) { //             $this->error(self::CREDENTIAL_EMPTY); return false ; } $ authAdapter = $ this -> auth -> getAdapter ( ) ; $ authAdapter -> setIdentity ( $ context [ $ this -> identity ] ) ; $ authAdapter -> setCredential ( $ context [ $ this -> credential ] ) ; $ result = $ this -> authResult = $ this -> auth -> authenticate ( ) ; if ( ! $ result -> isValid ( ) ) { $ this -> error ( $ result -> getCode ( ) ) ; return false ; } return true ; }
docstring: Test if authentication is valid
  
  @see \Zend\Validator\ValidatorInterface::isValid()
  @param mixed $value
  @param array $context
  @return boolean
docstring_tokens: Test if authentication is valid