From c4d2f2537696b52951938a5998805882f24fc375 Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Mon, 11 Dec 2023 12:34:54 +0100 Subject: [PATCH] refactor: remove endsWith() in Utils class in favor of str_ends_with (#375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHP 8.0 tiene str_ends_with() y str_starts_with(). Co-authored-by: Javier Ferrer González --- src/Shared/Domain/Utils.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/Shared/Domain/Utils.php b/src/Shared/Domain/Utils.php index 443c406e0..a50521eea 100644 --- a/src/Shared/Domain/Utils.php +++ b/src/Shared/Domain/Utils.php @@ -10,16 +10,6 @@ final class Utils { - public static function endsWith(string $needle, string $haystack): bool - { - $length = strlen($needle); - if ($length === 0) { - return true; - } - - return substr($haystack, -$length) === $needle; - } - public static function dateToString(DateTimeInterface $date): string { return $date->format(DateTimeInterface::ATOM);