ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSamlIdpXmlMetadataErrorFormatter Class Reference
+ Collaboration diagram for ilSamlIdpXmlMetadataErrorFormatter:

Public Member Functions

 formatErrors (LibXMLError ... $errors)
 Format a list of errors as a string. More...
 

Private Member Functions

 formatError (LibXMLError $error)
 Format an error as a string. More...
 

Detailed Description

Definition at line 21 of file class.ilSamlIdpXmlMetadataErrorFormatter.php.

Member Function Documentation

◆ formatError()

ilSamlIdpXmlMetadataErrorFormatter::formatError ( LibXMLError  $error)
private

Format an error as a string.

This function formats the given LibXMLError object as a string.

Parameters
LibXMLError$errorThe LibXMLError which should be formatted.
Returns
string A string representing the given LibXMLError.

Definition at line 29 of file class.ilSamlIdpXmlMetadataErrorFormatter.php.

29 : string
30 {
31 return implode(',', [
32 'level=' . $error->level,
33 'code=' . $error->code,
34 'line=' . $error->line,
35 'col=' . $error->column,
36 'msg=' . trim($error->message)
37 ]);
38 }

Referenced by formatErrors().

+ Here is the caller graph for this function:

◆ formatErrors()

ilSamlIdpXmlMetadataErrorFormatter::formatErrors ( LibXMLError ...  $errors)

Format a list of errors as a string.

This function takes an argument list of LibXMLError objects and creates a string with all the errors. Each error will be separated by a newline, and the string will end with a newline-character.

Parameters
LibXMLError...$errors A list of error arguments.
Returns
string A string representing the errors. An empty string will be returned if there were no errors in the argument list.

Definition at line 49 of file class.ilSamlIdpXmlMetadataErrorFormatter.php.

49 : string
50 {
51 $text = '';
52 foreach ($errors as $error) {
53 $text .= $this->formatError($error) . "\n";
54 }
55
56 return $text;
57 }
formatError(LibXMLError $error)
Format an error as a string.

References formatError().

+ Here is the call graph for this function:

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