ILIAS  release_8 Revision v8.24
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.

91 : void
92 {
93 $currentErrors = libxml_get_errors();
94 libxml_clear_errors();
95
96 $this->xmlErrors = $currentErrors;
97 }

Referenced by endXmlLogging().

+ Here is the caller graph for this function:

◆ beginXmlLogging()

ilTermsOfServiceDocumentsContainsHtmlValidator::beginXmlLogging ( )
private

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

85 : void
86 {
87 $this->xmlErrorState = libxml_use_internal_errors(true);
88 libxml_clear_errors();
89 }

◆ endXmlLogging()

ilTermsOfServiceDocumentsContainsHtmlValidator::endXmlLogging ( )
private

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

99 : void
100 {
101 $this->addErrors();
102
103 libxml_use_internal_errors($this->xmlErrorState);
104 }

References addErrors().

+ Here is the call graph for this function:

◆ relevantXmlErrors()

ilTermsOfServiceDocumentsContainsHtmlValidator::relevantXmlErrors ( )
private
Returns
LibXMLError[]

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

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 }

References LIBXML_CODE_HTML_UNKNOWN_TAG.

Referenced by xmlErrorsOccurred().

+ Here is the caller graph for this function:

◆ xmlErrorsOccurred()

ilTermsOfServiceDocumentsContainsHtmlValidator::xmlErrorsOccurred ( )
private

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

References relevantXmlErrors().

+ Here is the call 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: