From c3bad8097f7990693cc347f7e6265e5388e8cd81 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 5 Jan 2024 17:41:31 +0100 Subject: [PATCH] wip #6611 @0.25 --- src/Graphics/Lottie.php | 10 ++++------ src/Text.php | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Graphics/Lottie.php b/src/Graphics/Lottie.php index 2451829..a03f939 100644 --- a/src/Graphics/Lottie.php +++ b/src/Graphics/Lottie.php @@ -6,17 +6,15 @@ use Cubist\Util\Text; class Lottie { - protected static function getFileContents($path) - { - return Text::normalizeLines(file_get_contents($path)); - } + /** * @param $path * @return false|array */ - public static function getAnimationDataFromHTMLFile($path){ - $htmlContent = Text::normalizeLines(file_get_contents($path)); + public static function getAnimationDataFromHTMLFile($path) + { + $htmlContent = Text::fileGetContentsNormalizedLines($path); if (stristr($htmlContent, '
')) { if (preg_match('/var animationData = (\{.*\})/', $htmlContent, $m)) { return json_decode(trim($m[1]), true); diff --git a/src/Text.php b/src/Text.php index f3c9b2b..b5a5cb0 100644 --- a/src/Text.php +++ b/src/Text.php @@ -647,6 +647,10 @@ class Text return $text; } + public static function fileGetContentsNormalizedLines($path){ + return static::normalizeLines(file_get_contents($path)); + } + public static function underscoreToCamelCase($str, $upperFirst = false) { return Str::camel($str); -- 2.39.5