Passed
Push — master ( f42163...68b705 )
by Warwick
02:00
created
includes/classes/class-lsx-optimisation.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined('ABSPATH')) {
4 4
 	exit;
5 5
 }
6 6
 
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * Constructor.
27 27
 	 */
28 28
 	public function __construct() {
29
-		add_filter( 'style_loader_tag', array( $this, 'preload_css' ), 100, 4 );
30
-		add_filter( 'script_loader_tag', array( $this, 'defer_parsing_of_js' ), 100, 3 );
29
+		add_filter('style_loader_tag', array($this, 'preload_css'), 100, 4);
30
+		add_filter('script_loader_tag', array($this, 'defer_parsing_of_js'), 100, 3);
31 31
 	}
32 32
 	/**
33 33
 	 * Return an instance of this class.
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public static function get_instance() {
39 39
 		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
40
+		if (null === self::$instance) {
41 41
 			self::$instance = new self;
42 42
 		}
43 43
 		return self::$instance;
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	 * @param  string $url The url to check and defer.
50 50
 	 * @return string
51 51
 	 */
52
-	public function preload_css( $tag, $handle, $href, $media ) {
53
-		if ( 'lsx_fonts' === $handle || 'fontawesome' === $handle ) {
54
-			$tag = str_replace( 'href', ' preload href', $tag );
52
+	public function preload_css($tag, $handle, $href, $media) {
53
+		if ('lsx_fonts' === $handle || 'fontawesome' === $handle) {
54
+			$tag = str_replace('href', ' preload href', $tag);
55 55
 		}
56 56
 		return $tag;
57 57
 	}
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 * @param  string $url The url to check and defer.
63 63
 	 * @return string
64 64
 	 */
65
-	public function defer_parsing_of_js( $tag, $handle, $href ) {
66
-		if ( false !== stripos( $href, '.js' ) ) {
67
-			$tag = str_replace( 'src=', ' defer src=', $tag );
65
+	public function defer_parsing_of_js($tag, $handle, $href) {
66
+		if (false !== stripos($href, '.js')) {
67
+			$tag = str_replace('src=', ' defer src=', $tag);
68 68
 		}
69 69
 		return $tag;
70 70
 	}
Please login to merge, or discard this patch.