From 8982995445bb04ee164979ab5bcd1bd48f46ca4f Mon Sep 17 00:00:00 2001 From: Dag Date: Mon, 9 May 2022 23:32:45 +0200 Subject: [PATCH] refactor: remove unused method --- docs/08_Format_API/03_FormatAbstract.md | 9 --------- lib/FormatAbstract.php | 19 ------------------- 2 files changed, 28 deletions(-) diff --git a/docs/08_Format_API/03_FormatAbstract.md b/docs/08_Format_API/03_FormatAbstract.md index 3bb91bfd..82e42718 100644 --- a/docs/08_Format_API/03_FormatAbstract.md +++ b/docs/08_Format_API/03_FormatAbstract.md @@ -3,7 +3,6 @@ The `FormatAbstract` class implements the [`FormatInterface`](../08_Format_API/0 * [setContentType](#the-setcontenttype-function) * [callContentType](#the-callcontenttype-function) * [sanitizeHtml](#the-sanitizehtml-function) -* [array_trim](#the-array_trim-function) # Functions @@ -30,11 +29,3 @@ The `sanitizeHtml` function receives an HTML formatted string and returns the st ```PHP 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 -``` diff --git a/lib/FormatAbstract.php b/lib/FormatAbstract.php index 29e86cb4..cbc7dc97 100644 --- a/lib/FormatAbstract.php +++ b/lib/FormatAbstract.php @@ -181,23 +181,4 @@ abstract class FormatAbstract implements FormatInterface { // We leave alone object and embed so that videos can play in RSS readers. 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; - } }