refactor: remove unused method

This commit is contained in:
Dag 2022-05-09 23:32:45 +02:00
parent 76084cdcca
commit 8982995445
2 changed files with 0 additions and 28 deletions

View File

@ -3,7 +3,6 @@ The `FormatAbstract` class implements the [`FormatInterface`](../08_Format_API/0
* [setContentType](#the-setcontenttype-function) * [setContentType](#the-setcontenttype-function)
* [callContentType](#the-callcontenttype-function) * [callContentType](#the-callcontenttype-function)
* [sanitizeHtml](#the-sanitizehtml-function) * [sanitizeHtml](#the-sanitizehtml-function)
* [array_trim](#the-array_trim-function)
# Functions # Functions
@ -30,11 +29,3 @@ The `sanitizeHtml` function receives an HTML formatted string and returns the st
```PHP ```PHP
sanitizeHtml(string $html): string sanitizeHtml(string $html): string
``` ```
## The `array_trim` function
The `array_trim` function receives an array of strings and returns the same array with all elements trimmed (like using the `trim` function on all elements)
```PHP
array_trim(array $elements): array
```

View File

@ -181,23 +181,4 @@ abstract class FormatAbstract implements FormatInterface {
// We leave alone object and embed so that videos can play in RSS readers. // We leave alone object and embed so that videos can play in RSS readers.
return $html; return $html;
} }
/**
* Trim each element of an array
*
* This function applies `trim()` to all elements in the array, if the element
* is a valid string.
*
* @param array $elements The array to trim
* @return array The trimmed array
*
* @todo This is a utility function that doesn't belong here, find a new home.
*/
protected function array_trim($elements){
foreach($elements as $key => $value) {
if(is_string($value))
$elements[$key] = trim($value);
}
return $elements;
}
} }