ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceDocumentsContainsHtmlValidator Class Reference

Class ilTermsOfServiceDocumentsContainsHtmlValidator. More...

+ Collaboration diagram for ilTermsOfServiceDocumentsContainsHtmlValidator:

Public Member Functions

 __construct (string $text)
 

Private Member Functions

 beginXmlLogging ()
 
 addErrors ()
 
 endXmlLogging ()
 
 relevantXmlErrors ()
 
 xmlErrorsOccurred ()
 

Private Attributes

const LIBXML_CODE_HTML_UNKNOWN_TAG = 801
 
string $text
 
bool $xmlErrorState = false
 
array $xmlErrors = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceDocumentsContainsHtmlValidator::__construct ( string  $text)

Member Function Documentation

◆ addErrors()

ilTermsOfServiceDocumentsContainsHtmlValidator::addErrors ( )
private

Definition at line 91 of file class.ilTermsOfServiceDocumentsContainsHtmlValidator.php.

Referenced by endXmlLogging().

91  : void
92  {
93  $currentErrors = libxml_get_errors();
94  libxml_clear_errors();
95 
96  $this->xmlErrors = $currentErrors;
97  }
+ Here is the caller graph for this function:

◆ beginXmlLogging()

ilTermsOfServiceDocumentsContainsHtmlValidator::beginXmlLogging ( )
private

Definition at line 85 of file class.ilTermsOfServiceDocumentsContainsHtmlValidator.php.

Referenced by __construct().

85  : void
86  {
87  $this->xmlErrorState = libxml_use_internal_errors(true);
88  libxml_clear_errors();
89  }
+ Here is the caller graph for this function:

◆ endXmlLogging()

ilTermsOfServiceDocumentsContainsHtmlValidator::endXmlLogging ( )
private

Definition at line 99 of file class.ilTermsOfServiceDocumentsContainsHtmlValidator.php.

References addErrors().

Referenced by __construct().

99  : void
100  {
101  $this->addErrors();
102 
103  libxml_use_internal_errors($this->xmlErrorState);
104  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ relevantXmlErrors()

ilTermsOfServiceDocumentsContainsHtmlValidator::relevantXmlErrors ( )
private
Returns
LibXMLError[]

Definition at line 109 of file class.ilTermsOfServiceDocumentsContainsHtmlValidator.php.

Referenced by xmlErrorsOccurred().

109  : array
110  {
111  return array_filter($this->xmlErrors, static function (LibXMLError $error): bool {
112  return $error->code !== self::LIBXML_CODE_HTML_UNKNOWN_TAG;
113  });
114  }
+ Here is the caller graph for this function:

◆ xmlErrorsOccurred()

ilTermsOfServiceDocumentsContainsHtmlValidator::xmlErrorsOccurred ( )
private

Definition at line 116 of file class.ilTermsOfServiceDocumentsContainsHtmlValidator.php.

References relevantXmlErrors().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $text

string ilTermsOfServiceDocumentsContainsHtmlValidator::$text
private

◆ $xmlErrors

array ilTermsOfServiceDocumentsContainsHtmlValidator::$xmlErrors = []
private

◆ $xmlErrorState

bool ilTermsOfServiceDocumentsContainsHtmlValidator::$xmlErrorState = false
private

◆ LIBXML_CODE_HTML_UNKNOWN_TAG

const ilTermsOfServiceDocumentsContainsHtmlValidator::LIBXML_CODE_HTML_UNKNOWN_TAG = 801
private

The documentation for this class was generated from the following file: