]> _ Git - cubist_util.git/commitdiff
wip #6611 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Jan 2024 16:41:31 +0000 (17:41 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Jan 2024 16:41:31 +0000 (17:41 +0100)
src/Graphics/Lottie.php
src/Text.php

index 24518295d9d51914171305a7c3e6e0bdb09b589d..a03f939c6d8352435093658fe41c8d4472529086 100644 (file)
@@ -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, '<div id="lottie"></div>')) {
             if (preg_match('/var animationData = (\{.*\})/', $htmlContent, $m)) {
                 return json_decode(trim($m[1]), true);
index f3c9b2be41f6de8e95a76c419fb843bb0f02ce09..b5a5cb02512abbce32c8f978fdda58e5c278b3c5 100644 (file)
@@ -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);