| @@ -4,8 +4,8 @@ | ||
| 4 | 4 | |
| 5 | 5 | use Flynt\Features\Components\Component; | 
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=BlockImageText', function ($data) { | |
| 8 | -    add_action('wp_enqueue_scripts', function () { | |
| 7 | +add_filter('Flynt/addComponentData?name=BlockImageText', function($data) { | |
| 8 | +    add_action('wp_enqueue_scripts', function() { | |
| 9 | 9 |          Component::enqueueAssets('BlockImageText', [ | 
| 10 | 10 | [ | 
| 11 | 11 | 'name' => 'lazysizes', | 
| @@ -5,8 +5,8 @@ | ||
| 5 | 5 | use Flynt\Features\Components\Component; | 
| 6 | 6 | use Flynt\Utils\Oembed; | 
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=BlockVideoOembed', function ($data) { | |
| 9 | -    add_action('wp_enqueue_scripts', function () { | |
| 8 | +add_filter('Flynt/addComponentData?name=BlockVideoOembed', function($data) { | |
| 9 | +    add_action('wp_enqueue_scripts', function() { | |
| 10 | 10 |          Component::enqueueAssets('BlockVideoOembed', [ | 
| 11 | 11 | [ | 
| 12 | 12 | 'name' => 'lazysizes', | 
| @@ -4,8 +4,8 @@ | ||
| 4 | 4 | |
| 5 | 5 | use Flynt\Features\Components\Component; | 
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=BlockImage', function ($data) { | |
| 8 | -    add_action('wp_enqueue_scripts', function () { | |
| 7 | +add_filter('Flynt/addComponentData?name=BlockImage', function($data) { | |
| 8 | +    add_action('wp_enqueue_scripts', function() { | |
| 9 | 9 |          Component::enqueueAssets('BlockImage', [ | 
| 10 | 10 | [ | 
| 11 | 11 | 'name' => 'lazysizes', | 
| @@ -36,9 +36,9 @@ discard block | ||
| 36 | 36 | return $output; | 
| 37 | 37 | } | 
| 38 | 38 | |
| 39 | -    $addArea = function ($twig) use ($areaHtml) { | |
| 39 | +    $addArea = function($twig) use ($areaHtml) { | |
| 40 | 40 | |
| 41 | -        $twig->addFunction(new Twig_SimpleFunction('area', function ($areaName) use ($areaHtml) { | |
| 41 | +        $twig->addFunction(new Twig_SimpleFunction('area', function($areaName) use ($areaHtml) { | |
| 42 | 42 |              if (array_key_exists($areaName, $areaHtml)) { | 
| 43 | 43 | return $areaHtml[$areaName]; | 
| 44 | 44 | } | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | |
| 50 | 50 |      add_filter('get_twig', $addArea); | 
| 51 | 51 | |
| 52 | -    $returnTimberPaths = function ($paths) use ($filePath) { | |
| 52 | +    $returnTimberPaths = function($paths) use ($filePath) { | |
| 53 | 53 | array_unshift($paths, dirname($filePath)); | 
| 54 | 54 | return $paths; | 
| 55 | 55 | }; | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 | function formatGallery($value) | 
| 77 | 77 |  { | 
| 78 | 78 |      if (!empty($value)) { | 
| 79 | -        $value = array_map(function ($image) { | |
| 79 | +        $value = array_map(function($image) { | |
| 80 | 80 | return new Image($image); | 
| 81 | 81 | }, $value); | 
| 82 | 82 | } | 
| @@ -101,8 +101,8 @@ discard block | ||
| 101 | 101 | return $value; | 
| 102 | 102 | } | 
| 103 | 103 | |
| 104 | -add_action('timber/twig/filters', function ($twig) { | |
| 105 | -    $twig->addFunction(new \Twig_SimpleFunction('transparentPng', function ($aspect, $r = 0, $g = 0, $b = 0, $a = 127) { | |
| 104 | +add_action('timber/twig/filters', function($twig) { | |
| 105 | +    $twig->addFunction(new \Twig_SimpleFunction('transparentPng', function($aspect, $r = 0, $g = 0, $b = 0, $a = 127) { | |
| 106 | 106 | $ratio = aspectToRatio($aspect); | 
| 107 | 107 | //create image with specified sizes | 
| 108 | 108 | $image = imagecreatetruecolor($ratio['width'], $ratio['height']); | 
| @@ -131,7 +131,7 @@ discard block | ||
| 131 | 131 | $k2 = 1; | 
| 132 | 132 | $b = 1 / $n; | 
| 133 | 133 |      do { | 
| 134 | - $b = 1/$b; | |
| 134 | + $b = 1 / $b; | |
| 135 | 135 | $a = floor($b); | 
| 136 | 136 | $aux = $h1; | 
| 137 | 137 | $h1 = $a * $h1 + $h2; | 
| @@ -6,7 +6,7 @@ discard block | ||
| 6 | 6 | |
| 7 | 7 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); | 
| 8 | 8 | |
| 9 | -add_action('Flynt/afterRegisterFeatures', function () { | |
| 9 | +add_action('Flynt/afterRegisterFeatures', function() { | |
| 10 | 10 | $componentManager = Flynt\ComponentManager::getInstance(); | 
| 11 | 11 | $componentWhitelist = []; | 
| 12 | 12 |      if (isset($_GET['component']) && !empty($_GET['component'])) { | 
| @@ -43,21 +43,21 @@ discard block | ||
| 43 | 43 |  { | 
| 44 | 44 | $type = gettype($data); | 
| 45 | 45 | $output = json_encode($data); | 
| 46 | -    $result =  "<script>console.log({$output});</script>\n"; | |
| 46 | +    $result = "<script>console.log({$output});</script>\n"; | |
| 47 | 47 | echoDebug($result, $postpone); | 
| 48 | 48 | } | 
| 49 | 49 | |
| 50 | 50 | function consoleTable($data, $postpone = true) | 
| 51 | 51 |  { | 
| 52 | 52 | $output = json_encode($data); | 
| 53 | -    $result =  "<script>console.table({$output});</script>\n"; | |
| 53 | +    $result = "<script>console.table({$output});</script>\n"; | |
| 54 | 54 | echoDebug($result, $postpone); | 
| 55 | 55 | } | 
| 56 | 56 | |
| 57 | 57 | function echoDebug($data, $postpone) | 
| 58 | 58 |  { | 
| 59 | 59 |      if ($postpone) { | 
| 60 | -        add_action('wp_footer', function () use ($data) { | |
| 60 | +        add_action('wp_footer', function() use ($data) { | |
| 61 | 61 | echo $data; | 
| 62 | 62 | }, 30); | 
| 63 | 63 |      } else { | 
| @@ -15,7 +15,7 @@ discard block | ||
| 15 | 15 | |
| 16 | 16 |  add_action('Flynt/afterRegisterFeatures', 'Flynt\Features\Acf\Loader::init'); | 
| 17 | 17 | |
| 18 | -add_filter('pre_http_request', function ($preempt, $args, $url) { | |
| 18 | +add_filter('pre_http_request', function($preempt, $args, $url) { | |
| 19 | 19 |      if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { | 
| 20 | 20 | $response = wp_cache_get($url, 'oembedCache'); | 
| 21 | 21 |          if (!empty($response)) { | 
| @@ -25,7 +25,7 @@ discard block | ||
| 25 | 25 | return false; | 
| 26 | 26 | }, 10, 3); | 
| 27 | 27 | |
| 28 | -add_filter('http_response', function ($response, $args, $url) { | |
| 28 | +add_filter('http_response', function($response, $args, $url) { | |
| 29 | 29 |      if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { | 
| 30 | 30 | wp_cache_set($url, $response, 'oembedCache'); | 
| 31 | 31 | } |