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);
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);