original_string: public function getIdentity(): ?IdentityInterface
      {
          if (!$this->identity) {
              // check user agent
              if (Session::get('auth:agent') === Request::getServer('HTTP_USER_AGENT')) {
                  $this->identity = Session::get('auth:identity');
              } else {
                  $this->clearIdentity();
              }
          }
          return $this->identity;
      }
code: public function getIdentity(): ?IdentityInterface
      {
          if (!$this->identity) {
              // check user agent
              if (Session::get('auth:agent') === Request::getServer('HTTP_USER_AGENT')) {
                  $this->identity = Session::get('auth:identity');
              } else {
                  $this->clearIdentity();
              }
          }
          return $this->identity;
      }
code_tokens: public function getIdentity ( ) : ? IdentityInterface { if ( ! $ this -> identity ) { // check user agent if ( Session :: get ( 'auth:agent' ) === Request :: getServer ( 'HTTP_USER_AGENT' ) ) { $ this -> identity = Session :: get ( 'auth:identity' ) ; } else { $ this -> clearIdentity ( ) ; } } return $ this -> identity ; }
docstring: Return identity if user agent is correct
  
  @return IdentityInterface|null
docstring_tokens: Return identity if user agent is correct