code: public function acceptEndToken($token, $event)
      {
          if (! preg_match('/<\/(.*)>/', $token, $matches)) {
              return false;
          }
  
          return $this->listener->endElement(strtolower($matches[1]));
      }
docs: Accepts a token from the end tag mode. The element name is converted to lower case.
  
  @param string $token     Incoming characters.
  @param int $event    Lexer event type.
  
  @return bool          False if parse error.