Completed
Pull Request — develop (#1592)
by David
02:23 queued 01:17
created
src/modules/include-exclude/includes/admin/partials/field-0.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <p>
2
-	<input type="radio" id="wl_exclude_include_urls_settings_include_exclude_include" name="wl_exclude_include_urls_settings[include_exclude]" value="exclude" <?php checked( $options['include_exclude'], 'exclude', true ); // phpcs:ignore ?>>
3
-	<label for="wl_exclude_include_urls_settings_include_exclude_include"><?php echo esc_html__( 'Exclude', 'wordlift' ); ?></label>
2
+	<input type="radio" id="wl_exclude_include_urls_settings_include_exclude_include" name="wl_exclude_include_urls_settings[include_exclude]" value="exclude" <?php checked($options['include_exclude'], 'exclude', true); // phpcs:ignore ?>>
3
+	<label for="wl_exclude_include_urls_settings_include_exclude_include"><?php echo esc_html__('Exclude', 'wordlift'); ?></label>
4 4
 </p>
5 5
 <p>
6
-	<input type="radio" id="wl_exclude_include_urls_settings_include_exclude_exclude" name="wl_exclude_include_urls_settings[include_exclude]" value="include" <?php checked( $options['include_exclude'], 'include', true ); // phpcs:ignore ?>>
7
-	<label for="wl_exclude_include_urls_settings_include_exclude_exclude"><?php echo esc_html__( 'Include', 'wordlift' ); ?></label>
6
+	<input type="radio" id="wl_exclude_include_urls_settings_include_exclude_exclude" name="wl_exclude_include_urls_settings[include_exclude]" value="include" <?php checked($options['include_exclude'], 'include', true); // phpcs:ignore ?>>
7
+	<label for="wl_exclude_include_urls_settings_include_exclude_exclude"><?php echo esc_html__('Include', 'wordlift'); ?></label>
8 8
 </p>
Please login to merge, or discard this patch.
include-exclude/includes/admin/partials/exclude-include-urls-page.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 	<h2><?php echo esc_html__( 'Exclude / Include URLs', 'wordlift' ); ?></h2>
3 3
 	<form action='options.php' method='post'>
4 4
 		<?php
5
-		settings_fields( 'wl_exclude_include_urls_settings_group' );
6
-		do_settings_sections( 'wl_exclude_include_urls_settings_page' );
7
-		submit_button();
8
-		?>
5
+        settings_fields( 'wl_exclude_include_urls_settings_group' );
6
+        do_settings_sections( 'wl_exclude_include_urls_settings_page' );
7
+        submit_button();
8
+        ?>
9 9
 	</form>
10 10
 </div>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <div class="wrap" id="wl-settings-page">
2
-	<h2><?php echo esc_html__( 'Exclude / Include URLs', 'wordlift' ); ?></h2>
2
+	<h2><?php echo esc_html__('Exclude / Include URLs', 'wordlift'); ?></h2>
3 3
 	<form action='options.php' method='post'>
4 4
 		<?php
5
-		settings_fields( 'wl_exclude_include_urls_settings_group' );
6
-		do_settings_sections( 'wl_exclude_include_urls_settings_page' );
5
+		settings_fields('wl_exclude_include_urls_settings_group');
6
+		do_settings_sections('wl_exclude_include_urls_settings_page');
7 7
 		submit_button();
8 8
 		?>
9 9
 	</form>
Please login to merge, or discard this patch.
src/modules/include-exclude/includes/admin/partials/field-1.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <p>
2 2
 	<label for="wl_exclude_include_urls_settings_urls">
3 3
 		<?php
4
-		echo sprintf(
5
-			'%s <code>%s</code>',
6
-			esc_html__( 'One relative or absolute URL per line. Relative URLs will be converted to absolute in context of', 'wordlift' ),
7
-			esc_url( site_url() )
8
-		);
9
-		?>
4
+        echo sprintf(
5
+            '%s <code>%s</code>',
6
+            esc_html__( 'One relative or absolute URL per line. Relative URLs will be converted to absolute in context of', 'wordlift' ),
7
+            esc_url( site_url() )
8
+        );
9
+        ?>
10 10
 	</label>
11 11
 </p>
12 12
 <p>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@
 block discarded – undo
3 3
 		<?php
4 4
 		echo sprintf(
5 5
 			'%s <code>%s</code>',
6
-			esc_html__( 'One relative or absolute URL per line. Relative URLs will be converted to absolute in context of', 'wordlift' ),
7
-			esc_url( site_url() )
6
+			esc_html__('One relative or absolute URL per line. Relative URLs will be converted to absolute in context of', 'wordlift'),
7
+			esc_url(site_url())
8 8
 		);
9 9
 		?>
10 10
 	</label>
11 11
 </p>
12 12
 <p>
13
-	<textarea id="wl_exclude_include_urls_settings_urls" name='wl_exclude_include_urls_settings[urls]' class="large-text code" rows="10"><?php echo esc_textarea( $options['urls'] ); // phpcs:ignore ?></textarea>
13
+	<textarea id="wl_exclude_include_urls_settings_urls" name='wl_exclude_include_urls_settings[urls]' class="large-text code" rows="10"><?php echo esc_textarea($options['urls']); // phpcs:ignore ?></textarea>
14 14
 </p>
Please login to merge, or discard this patch.
src/wordlift.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -32,24 +32,24 @@  discard block
 block discarded – undo
32 32
 use Wordlift\Post\Post_Adapter;
33 33
 
34 34
 // If this file is called directly, abort.
35
-if ( ! defined( 'WPINC' ) ) {
35
+if ( ! defined('WPINC')) {
36 36
 	die;
37 37
 }
38 38
 
39
-define( 'WORDLIFT_VERSION', '3.39.0-dev' );
40
-require_once __DIR__ . '/modules/common/load.php';
41
-require_once __DIR__ . '/modules/include-exclude/load.php';
39
+define('WORDLIFT_VERSION', '3.39.0-dev');
40
+require_once __DIR__.'/modules/common/load.php';
41
+require_once __DIR__.'/modules/include-exclude/load.php';
42 42
 
43 43
 /**
44 44
  * Filter to disable WLP on any request, defaults to true.
45 45
  *
46 46
  * @since 3.33.6
47 47
  */
48
-if ( ! apply_filters( 'wl_is_enabled', true ) ) {
48
+if ( ! apply_filters('wl_is_enabled', true)) {
49 49
 	return;
50 50
 }
51 51
 
52
-require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
52
+require_once plugin_dir_path(__FILE__).'vendor/autoload.php';
53 53
 
54 54
 /*
55 55
 	 * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http.
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 wordlift_plugin_autoload_register();
60 60
 
61 61
 // Include WordLift constants.
62
-require_once plugin_dir_path( __FILE__ ) . 'wordlift-constants.php';
62
+require_once plugin_dir_path(__FILE__).'wordlift-constants.php';
63 63
 
64 64
 // Load modules.
65
-require_once plugin_dir_path( __FILE__ ) . 'modules/core/wordlift-core.php';
65
+require_once plugin_dir_path(__FILE__).'modules/core/wordlift-core.php';
66 66
 
67
-require_once plugin_dir_path( __FILE__ ) . 'deprecations.php';
67
+require_once plugin_dir_path(__FILE__).'deprecations.php';
68 68
 
69 69
 // Load early to enable/disable features.
70
-require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php';
70
+require_once plugin_dir_path(__FILE__).'wordlift/features/index.php';
71 71
 
72 72
 /**
73 73
  * The code that runs during plugin activation.
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function activate_wordlift() {
77 77
 
78
-	$log = Wordlift_Log_Service::get_logger( 'activate_wordlift' );
78
+	$log = Wordlift_Log_Service::get_logger('activate_wordlift');
79 79
 
80
-	$log->info( 'Activating WordLift...' );
80
+	$log->info('Activating WordLift...');
81 81
 
82
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php';
82
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-activator.php';
83 83
 	Wordlift_Activator::activate();
84 84
 
85 85
 	/**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
  */
107 107
 function deactivate_wordlift() {
108 108
 
109
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php';
109
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-deactivator.php';
110 110
 	Wordlift_Deactivator::deactivate();
111 111
 	Wordlift_Http_Api::deactivate();
112 112
 	Ttl_Cache_Cleaner::deactivate();
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
 
125 125
 }
126 126
 
127
-register_activation_hook( __FILE__, 'activate_wordlift' );
128
-register_deactivation_hook( __FILE__, 'deactivate_wordlift' );
127
+register_activation_hook(__FILE__, 'activate_wordlift');
128
+register_deactivation_hook(__FILE__, 'deactivate_wordlift');
129 129
 
130 130
 /**
131 131
  * The core plugin class that is used to define internationalization,
132 132
  * admin-specific hooks, and public-facing site hooks.
133 133
  */
134
-require plugin_dir_path( __FILE__ ) . 'includes/class-wordlift.php';
134
+require plugin_dir_path(__FILE__).'includes/class-wordlift.php';
135 135
 
136 136
 /**
137 137
  * Begins execution of the plugin.
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 	 * @return bool
152 152
 	 * @since 3.27.6
153 153
 	 */
154
-	if ( apply_filters( 'wl_feature__enable__widgets', true ) ) {
155
-		add_action( 'widgets_init', 'wl_register_chord_widget' );
156
-		add_action( 'widgets_init', 'wl_register_geo_widget' );
157
-		add_action( 'widgets_init', 'wl_register_timeline_widget' );
154
+	if (apply_filters('wl_feature__enable__widgets', true)) {
155
+		add_action('widgets_init', 'wl_register_chord_widget');
156
+		add_action('widgets_init', 'wl_register_geo_widget');
157
+		add_action('widgets_init', 'wl_register_timeline_widget');
158 158
 	}
159
-	add_filter( 'widget_text', 'do_shortcode' );
159
+	add_filter('widget_text', 'do_shortcode');
160 160
 
161 161
 	/**
162 162
 	 * Filter: wl_feature__enable__analysis
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 	 * @return bool
167 167
 	 * @since 3.27.6
168 168
 	 */
169
-	if ( apply_filters( 'wl_feature__enable__analysis', true ) ) {
170
-		add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' );
169
+	if (apply_filters('wl_feature__enable__analysis', true)) {
170
+		add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_action');
171 171
 	} else {
172
-		add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' );
172
+		add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action');
173 173
 	}
174 174
 
175 175
 	$plugin = new Wordlift();
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
 	add_action(
188 188
 		'plugins_loaded',
189
-		function () {
189
+		function() {
190 190
 			// All features from registry should be initialized here.
191 191
 			$features_registry = Features_Registry::get_instance();
192 192
 			$features_registry->initialize_all_features();
@@ -197,27 +197,27 @@  discard block
 block discarded – undo
197 197
 	add_action(
198 198
 		'plugins_loaded',
199 199
 		// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
200
-		function () use ( $plugin ) {
200
+		function() use ($plugin) {
201 201
 
202 202
 			new Wordlift_Products_Navigator_Shortcode_REST();
203 203
 
204 204
 			// Register the Dataset module, requires `$api_service`.
205
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php';
206
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/shipping-data/index.php';
205
+			require_once plugin_dir_path(__FILE__).'wordlift/dataset/index.php';
206
+			require_once plugin_dir_path(__FILE__).'wordlift/shipping-data/index.php';
207 207
 
208 208
 			/*
209 209
 			* Require the Entity annotation cleanup module.
210 210
 			*
211 211
 			* @since 3.34.6
212 212
 			*/
213
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/cleanup/index.php';
213
+			require_once plugin_dir_path(__FILE__).'wordlift/cleanup/index.php';
214 214
 
215 215
 			/*
216 216
 			* Import LOD entities.
217 217
 			*
218 218
 			* @since 3.35.0
219 219
 			*/
220
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/lod-import/index.php';
220
+			require_once plugin_dir_path(__FILE__).'wordlift/lod-import/index.php';
221 221
 
222 222
 		}
223 223
 	);
@@ -235,23 +235,23 @@  discard block
 block discarded – undo
235 235
 function wordlift_plugin_autoload_register() {
236 236
 
237 237
 	spl_autoload_register(
238
-		function ( $class_name ) {
238
+		function($class_name) {
239 239
 
240 240
 			// Bail out if these are not our classes.
241
-			if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) {
241
+			if (0 !== strpos($class_name, 'Wordlift\\')) {
242 242
 				return false;
243 243
 			}
244 244
 
245
-			$class_name_lc = strtolower( str_replace( '_', '-', $class_name ) );
245
+			$class_name_lc = strtolower(str_replace('_', '-', $class_name));
246 246
 
247
-			preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches );
247
+			preg_match('|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches);
248 248
 
249
-			$path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] );
250
-			$file = 'class-' . $matches[2] . '.php';
249
+			$path = str_replace('\\', DIRECTORY_SEPARATOR, $matches[1]);
250
+			$file = 'class-'.$matches[2].'.php';
251 251
 
252
-			$full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file;
252
+			$full_path = plugin_dir_path(__FILE__).$path.DIRECTORY_SEPARATOR.$file;
253 253
 
254
-			if ( ! file_exists( $full_path ) ) {
254
+			if ( ! file_exists($full_path)) {
255 255
 				return false;
256 256
 			}
257 257
 
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 
264 264
 }
265 265
 
266
-function wl_block_categories( $categories ) {
266
+function wl_block_categories($categories) {
267 267
 	return array_merge(
268 268
 		$categories,
269 269
 		array(
270 270
 			array(
271 271
 				'slug'  => 'wordlift',
272
-				'title' => __( 'WordLift', 'wordlift' ),
272
+				'title' => __('WordLift', 'wordlift'),
273 273
 			),
274 274
 		)
275 275
 	);
@@ -279,22 +279,22 @@  discard block
 block discarded – undo
279 279
  * This function is created temporarily to handle the legacy library,
280 280
  * this has to be removed when removing the legacy fields from the ui.
281 281
  */
282
-function wl_enqueue_leaflet( $in_footer = false ) {
282
+function wl_enqueue_leaflet($in_footer = false) {
283 283
 	// Leaflet.
284
-	wp_enqueue_style( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.css', array(), '1.6.0' );
285
-	wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer );
284
+	wp_enqueue_style('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.css', array(), '1.6.0');
285
+	wp_enqueue_script('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer);
286 286
 }
287 287
 
288
-add_filter( 'block_categories', 'wl_block_categories', 10 );
288
+add_filter('block_categories', 'wl_block_categories', 10);
289 289
 
290 290
 // Temporary fix for a typo in WooCommerce Extension.
291 291
 add_filter(
292 292
 	'wl_feature__enable__dataset',
293
-	function ( $value ) {
294
-		return apply_filters( 'wl_features__enable__dataset', $value );
293
+	function($value) {
294
+		return apply_filters('wl_features__enable__dataset', $value);
295 295
 	}
296 296
 );
297 297
 
298
-require_once __DIR__ . '/modules/food-kg/load.php';
299
-require_once __DIR__ . '/modules/acf4so/load.php';
300
-require_once __DIR__ . '/modules/pods/load.php';
298
+require_once __DIR__.'/modules/food-kg/load.php';
299
+require_once __DIR__.'/modules/acf4so/load.php';
300
+require_once __DIR__.'/modules/pods/load.php';
Please login to merge, or discard this patch.
src/modules/include-exclude/includes/Plugin_Enabled.php 2 patches
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -16,96 +16,96 @@
 block discarded – undo
16 16
  */
17 17
 class Plugin_Enabled {
18 18
 
19
-	/**
20
-	 * Register hooks.
21
-	 */
22
-	public function register_hooks() {
23
-		add_filter( 'wl_is_enabled', array( $this, 'wl_is_enabled' ) );
24
-		add_filter( 'wl_jsonld_term_html_output', array( $this, 'may_be_exclude_nitropack' ) );
25
-		add_filter( 'wl_jsonld_post_html_output', array( $this, 'may_be_exclude_nitropack' ) );
26
-	}
27
-
28
-	/**
29
-	 * Modify JSON-LD if Nitropack active.
30
-	 *
31
-	 * @param $html
32
-	 *
33
-	 * @return array|mixed|string|string[]
34
-	 */
35
-	public function may_be_exclude_nitropack( $html ) {
36
-		if ( ! defined( 'NITROPACK_VERSION' ) ) {
37
-			return $html;
38
-		}
39
-		$html = str_replace( 'id="wl-jsonld"', 'id="wl-jsonld" nitro-exclude', $html );
40
-		$html = str_replace( 'id="wl-jsonld-term"', 'id="wl-jsonld-term" nitro-exclude', $html );
41
-
42
-		return $html;
43
-	}
44
-
45
-	/**
46
-	 * Enable/Disable WordLift Plugin.
47
-	 *
48
-	 * @param $enabled
49
-	 *
50
-	 * @return bool|mixed
51
-	 */
52
-	public function wl_is_enabled( $enabled ) {
53
-
54
-		// Always enable wordlift on admin and rest api pages.
55
-		if ( is_admin() || $this->is_rest_request() ) {
56
-			return $enabled;
57
-		}
58
-
59
-		$path        = strtok( (string) $_SERVER['REQUEST_URI'], '?' ); // phpcs:ignore
60
-		$options     = get_option( 'wl_exclude_include_urls_settings' );
61
-		$current_url = trailingslashit( home_url( $path ) );
62
-
63
-		// Bail out if URLs are not set.
64
-		if ( empty( $options['urls'] ) ) {
65
-			return $enabled;
66
-		}
67
-
68
-		// Set a default state
69
-		$default_state = $options['include_exclude'] === 'exclude' ? true : false;
70
-
71
-		// Get URLs into an array from settings, trim them and make absolute if needed.
72
-		$urls = array_map(
73
-			function ( $url ) {
74
-				$url = trim( $url );
75
-				if ( substr( $url, 0, 4 ) !== 'http' ) {
76
-					return trailingslashit( home_url( $url ) );
77
-				}
78
-
79
-				// Add a trailing slash and return the url
80
-				return trailingslashit( $url );
81
-			},
82
-			explode( PHP_EOL, $options['urls'] )
83
-		);
84
-
85
-		foreach ( $urls as $url ) {
86
-			if ( $url === $current_url ) {
87
-				return ! $default_state;
88
-			}
89
-		}
90
-		return $default_state;
91
-
92
-	}
93
-
94
-	/**
95
-	 * We cant rely on WP_REST_REQUEST constant here since it is loaded after init hook
96
-	 *
97
-	 * @return bool
98
-	 */
99
-	protected function is_rest_request() {
100
-		if ( empty( $_SERVER['REQUEST_URI'] ) ) {
101
-			// Probably a CLI request.
102
-			return false;
103
-		}
104
-
105
-		$rest_prefix = trailingslashit( rest_get_url_prefix() );
106
-		$path        = strtok( (string) $_SERVER['REQUEST_URI'], '?' ); // phpcs:ignore
107
-
108
-		return strpos( $path, $rest_prefix ) !== false;
109
-	}
19
+    /**
20
+     * Register hooks.
21
+     */
22
+    public function register_hooks() {
23
+        add_filter( 'wl_is_enabled', array( $this, 'wl_is_enabled' ) );
24
+        add_filter( 'wl_jsonld_term_html_output', array( $this, 'may_be_exclude_nitropack' ) );
25
+        add_filter( 'wl_jsonld_post_html_output', array( $this, 'may_be_exclude_nitropack' ) );
26
+    }
27
+
28
+    /**
29
+     * Modify JSON-LD if Nitropack active.
30
+     *
31
+     * @param $html
32
+     *
33
+     * @return array|mixed|string|string[]
34
+     */
35
+    public function may_be_exclude_nitropack( $html ) {
36
+        if ( ! defined( 'NITROPACK_VERSION' ) ) {
37
+            return $html;
38
+        }
39
+        $html = str_replace( 'id="wl-jsonld"', 'id="wl-jsonld" nitro-exclude', $html );
40
+        $html = str_replace( 'id="wl-jsonld-term"', 'id="wl-jsonld-term" nitro-exclude', $html );
41
+
42
+        return $html;
43
+    }
44
+
45
+    /**
46
+     * Enable/Disable WordLift Plugin.
47
+     *
48
+     * @param $enabled
49
+     *
50
+     * @return bool|mixed
51
+     */
52
+    public function wl_is_enabled( $enabled ) {
53
+
54
+        // Always enable wordlift on admin and rest api pages.
55
+        if ( is_admin() || $this->is_rest_request() ) {
56
+            return $enabled;
57
+        }
58
+
59
+        $path        = strtok( (string) $_SERVER['REQUEST_URI'], '?' ); // phpcs:ignore
60
+        $options     = get_option( 'wl_exclude_include_urls_settings' );
61
+        $current_url = trailingslashit( home_url( $path ) );
62
+
63
+        // Bail out if URLs are not set.
64
+        if ( empty( $options['urls'] ) ) {
65
+            return $enabled;
66
+        }
67
+
68
+        // Set a default state
69
+        $default_state = $options['include_exclude'] === 'exclude' ? true : false;
70
+
71
+        // Get URLs into an array from settings, trim them and make absolute if needed.
72
+        $urls = array_map(
73
+            function ( $url ) {
74
+                $url = trim( $url );
75
+                if ( substr( $url, 0, 4 ) !== 'http' ) {
76
+                    return trailingslashit( home_url( $url ) );
77
+                }
78
+
79
+                // Add a trailing slash and return the url
80
+                return trailingslashit( $url );
81
+            },
82
+            explode( PHP_EOL, $options['urls'] )
83
+        );
84
+
85
+        foreach ( $urls as $url ) {
86
+            if ( $url === $current_url ) {
87
+                return ! $default_state;
88
+            }
89
+        }
90
+        return $default_state;
91
+
92
+    }
93
+
94
+    /**
95
+     * We cant rely on WP_REST_REQUEST constant here since it is loaded after init hook
96
+     *
97
+     * @return bool
98
+     */
99
+    protected function is_rest_request() {
100
+        if ( empty( $_SERVER['REQUEST_URI'] ) ) {
101
+            // Probably a CLI request.
102
+            return false;
103
+        }
104
+
105
+        $rest_prefix = trailingslashit( rest_get_url_prefix() );
106
+        $path        = strtok( (string) $_SERVER['REQUEST_URI'], '?' ); // phpcs:ignore
107
+
108
+        return strpos( $path, $rest_prefix ) !== false;
109
+    }
110 110
 
111 111
 }
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
 	 * Register hooks.
21 21
 	 */
22 22
 	public function register_hooks() {
23
-		add_filter( 'wl_is_enabled', array( $this, 'wl_is_enabled' ) );
24
-		add_filter( 'wl_jsonld_term_html_output', array( $this, 'may_be_exclude_nitropack' ) );
25
-		add_filter( 'wl_jsonld_post_html_output', array( $this, 'may_be_exclude_nitropack' ) );
23
+		add_filter('wl_is_enabled', array($this, 'wl_is_enabled'));
24
+		add_filter('wl_jsonld_term_html_output', array($this, 'may_be_exclude_nitropack'));
25
+		add_filter('wl_jsonld_post_html_output', array($this, 'may_be_exclude_nitropack'));
26 26
 	}
27 27
 
28 28
 	/**
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @return array|mixed|string|string[]
34 34
 	 */
35
-	public function may_be_exclude_nitropack( $html ) {
36
-		if ( ! defined( 'NITROPACK_VERSION' ) ) {
35
+	public function may_be_exclude_nitropack($html) {
36
+		if ( ! defined('NITROPACK_VERSION')) {
37 37
 			return $html;
38 38
 		}
39
-		$html = str_replace( 'id="wl-jsonld"', 'id="wl-jsonld" nitro-exclude', $html );
40
-		$html = str_replace( 'id="wl-jsonld-term"', 'id="wl-jsonld-term" nitro-exclude', $html );
39
+		$html = str_replace('id="wl-jsonld"', 'id="wl-jsonld" nitro-exclude', $html);
40
+		$html = str_replace('id="wl-jsonld-term"', 'id="wl-jsonld-term" nitro-exclude', $html);
41 41
 
42 42
 		return $html;
43 43
 	}
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @return bool|mixed
51 51
 	 */
52
-	public function wl_is_enabled( $enabled ) {
52
+	public function wl_is_enabled($enabled) {
53 53
 
54 54
 		// Always enable wordlift on admin and rest api pages.
55
-		if ( is_admin() || $this->is_rest_request() ) {
55
+		if (is_admin() || $this->is_rest_request()) {
56 56
 			return $enabled;
57 57
 		}
58 58
 
59
-		$path        = strtok( (string) $_SERVER['REQUEST_URI'], '?' ); // phpcs:ignore
60
-		$options     = get_option( 'wl_exclude_include_urls_settings' );
61
-		$current_url = trailingslashit( home_url( $path ) );
59
+		$path        = strtok((string) $_SERVER['REQUEST_URI'], '?'); // phpcs:ignore
60
+		$options     = get_option('wl_exclude_include_urls_settings');
61
+		$current_url = trailingslashit(home_url($path));
62 62
 
63 63
 		// Bail out if URLs are not set.
64
-		if ( empty( $options['urls'] ) ) {
64
+		if (empty($options['urls'])) {
65 65
 			return $enabled;
66 66
 		}
67 67
 
@@ -70,20 +70,20 @@  discard block
 block discarded – undo
70 70
 
71 71
 		// Get URLs into an array from settings, trim them and make absolute if needed.
72 72
 		$urls = array_map(
73
-			function ( $url ) {
74
-				$url = trim( $url );
75
-				if ( substr( $url, 0, 4 ) !== 'http' ) {
76
-					return trailingslashit( home_url( $url ) );
73
+			function($url) {
74
+				$url = trim($url);
75
+				if (substr($url, 0, 4) !== 'http') {
76
+					return trailingslashit(home_url($url));
77 77
 				}
78 78
 
79 79
 				// Add a trailing slash and return the url
80
-				return trailingslashit( $url );
80
+				return trailingslashit($url);
81 81
 			},
82
-			explode( PHP_EOL, $options['urls'] )
82
+			explode(PHP_EOL, $options['urls'])
83 83
 		);
84 84
 
85
-		foreach ( $urls as $url ) {
86
-			if ( $url === $current_url ) {
85
+		foreach ($urls as $url) {
86
+			if ($url === $current_url) {
87 87
 				return ! $default_state;
88 88
 			}
89 89
 		}
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
 	 * @return bool
98 98
 	 */
99 99
 	protected function is_rest_request() {
100
-		if ( empty( $_SERVER['REQUEST_URI'] ) ) {
100
+		if (empty($_SERVER['REQUEST_URI'])) {
101 101
 			// Probably a CLI request.
102 102
 			return false;
103 103
 		}
104 104
 
105
-		$rest_prefix = trailingslashit( rest_get_url_prefix() );
106
-		$path        = strtok( (string) $_SERVER['REQUEST_URI'], '?' ); // phpcs:ignore
105
+		$rest_prefix = trailingslashit(rest_get_url_prefix());
106
+		$path        = strtok((string) $_SERVER['REQUEST_URI'], '?'); // phpcs:ignore
107 107
 
108
-		return strpos( $path, $rest_prefix ) !== false;
108
+		return strpos($path, $rest_prefix) !== false;
109 109
 	}
110 110
 
111 111
 }
Please login to merge, or discard this patch.
src/modules/include-exclude/includes/admin/Settings.php 2 patches
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -14,89 +14,89 @@
 block discarded – undo
14 14
  */
15 15
 class Settings {
16 16
 
17
-	/**
18
-	 * Register hooks.
19
-	 */
20
-	public function register_hooks() {
21
-		if ( is_admin() ) {
22
-			add_action(
23
-				'plugins_loaded',
24
-				function () {
25
-					add_action( 'admin_menu', array( $this, 'register_sub_menu' ) );
26
-					add_action( 'admin_init', array( $this, 'register_setting' ) );
27
-				}
28
-			);
29
-		}
30
-	}
17
+    /**
18
+     * Register hooks.
19
+     */
20
+    public function register_hooks() {
21
+        if ( is_admin() ) {
22
+            add_action(
23
+                'plugins_loaded',
24
+                function () {
25
+                    add_action( 'admin_menu', array( $this, 'register_sub_menu' ) );
26
+                    add_action( 'admin_init', array( $this, 'register_setting' ) );
27
+                }
28
+            );
29
+        }
30
+    }
31 31
 
32
-	/**
33
-	 * Register submenu.
34
-	 */
35
-	public function register_sub_menu() {
36
-		add_submenu_page(
37
-			'wl_admin_menu',
38
-			__( 'Exclude Include URLs', 'wordlift' ),
39
-			__( 'Exclude Include URLs', 'wordlift' ),
40
-			'manage_options',
41
-			'wl_exclude_include_urls_menu',
42
-			array( $this, 'submenu_page_callback' )
43
-		);
44
-	}
32
+    /**
33
+     * Register submenu.
34
+     */
35
+    public function register_sub_menu() {
36
+        add_submenu_page(
37
+            'wl_admin_menu',
38
+            __( 'Exclude Include URLs', 'wordlift' ),
39
+            __( 'Exclude Include URLs', 'wordlift' ),
40
+            'manage_options',
41
+            'wl_exclude_include_urls_menu',
42
+            array( $this, 'submenu_page_callback' )
43
+        );
44
+    }
45 45
 
46
-	/**
47
-	 * Register settings.
48
-	 */
49
-	public function register_setting() {
50
-		register_setting( 'wl_exclude_include_urls_settings_group', 'wl_exclude_include_urls_settings' );
51
-		add_settings_section(
52
-			'wl_exclude_include_urls_settings_section_0',
53
-			__( 'URL filter type, list of URLs', 'wordlift' ),
54
-			array( $this, 'settings_section_callback' ),
55
-			'wl_exclude_include_urls_settings_page'
56
-		);
46
+    /**
47
+     * Register settings.
48
+     */
49
+    public function register_setting() {
50
+        register_setting( 'wl_exclude_include_urls_settings_group', 'wl_exclude_include_urls_settings' );
51
+        add_settings_section(
52
+            'wl_exclude_include_urls_settings_section_0',
53
+            __( 'URL filter type, list of URLs', 'wordlift' ),
54
+            array( $this, 'settings_section_callback' ),
55
+            'wl_exclude_include_urls_settings_page'
56
+        );
57 57
 
58
-		add_settings_field(
59
-			'wl_exclude_include_urls_field_0',
60
-			__( 'URLs filter type', 'wordlift' ),
61
-			array( $this, 'settings_field_0_render' ),
62
-			'wl_exclude_include_urls_settings_page',
63
-			'wl_exclude_include_urls_settings_section_0'
64
-		);
58
+        add_settings_field(
59
+            'wl_exclude_include_urls_field_0',
60
+            __( 'URLs filter type', 'wordlift' ),
61
+            array( $this, 'settings_field_0_render' ),
62
+            'wl_exclude_include_urls_settings_page',
63
+            'wl_exclude_include_urls_settings_section_0'
64
+        );
65 65
 
66
-		add_settings_field(
67
-			'wl_exclude_include_urls_field_1',
68
-			__( 'List of URLs', 'wordlift' ),
69
-			array( $this, 'settings_field_1_render' ),
70
-			'wl_exclude_include_urls_settings_page',
71
-			'wl_exclude_include_urls_settings_section_0'
72
-		);
73
-	}
66
+        add_settings_field(
67
+            'wl_exclude_include_urls_field_1',
68
+            __( 'List of URLs', 'wordlift' ),
69
+            array( $this, 'settings_field_1_render' ),
70
+            'wl_exclude_include_urls_settings_page',
71
+            'wl_exclude_include_urls_settings_section_0'
72
+        );
73
+    }
74 74
 
75
-	public function settings_section_callback() {
76
-		echo esc_html__( 'Select a URL filter type, and add list of URLs to selective active from WordLift\'s JSON-LD', 'wordlift' );
77
-	}
75
+    public function settings_section_callback() {
76
+        echo esc_html__( 'Select a URL filter type, and add list of URLs to selective active from WordLift\'s JSON-LD', 'wordlift' );
77
+    }
78 78
 
79
-	/**
80
-	 * Callback function for settings field rendering.
81
-	 */
82
-	public function settings_field_0_render() {
83
-		$options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore
84
-		include plugin_dir_path( __FILE__ ) . 'partials/field-0.php';
85
-	}
79
+    /**
80
+     * Callback function for settings field rendering.
81
+     */
82
+    public function settings_field_0_render() {
83
+        $options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore
84
+        include plugin_dir_path( __FILE__ ) . 'partials/field-0.php';
85
+    }
86 86
 
87
-	/**
88
-	 * Callback function for settings field rendering.
89
-	 */
90
-	public function settings_field_1_render() {
91
-		$options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore
92
-		include plugin_dir_path( __FILE__ ) . 'partials/field-1.php';
93
-	}
87
+    /**
88
+     * Callback function for settings field rendering.
89
+     */
90
+    public function settings_field_1_render() {
91
+        $options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore
92
+        include plugin_dir_path( __FILE__ ) . 'partials/field-1.php';
93
+    }
94 94
 
95
-	/**
96
-	 * Callback function for Exclude Include URLs submenu page.
97
-	 */
98
-	public function submenu_page_callback() {
99
-		include plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php';
100
-	}
95
+    /**
96
+     * Callback function for Exclude Include URLs submenu page.
97
+     */
98
+    public function submenu_page_callback() {
99
+        include plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php';
100
+    }
101 101
 
102 102
 }
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 	 * Register hooks.
19 19
 	 */
20 20
 	public function register_hooks() {
21
-		if ( is_admin() ) {
21
+		if (is_admin()) {
22 22
 			add_action(
23 23
 				'plugins_loaded',
24
-				function () {
25
-					add_action( 'admin_menu', array( $this, 'register_sub_menu' ) );
26
-					add_action( 'admin_init', array( $this, 'register_setting' ) );
24
+				function() {
25
+					add_action('admin_menu', array($this, 'register_sub_menu'));
26
+					add_action('admin_init', array($this, 'register_setting'));
27 27
 				}
28 28
 			);
29 29
 		}
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 	public function register_sub_menu() {
36 36
 		add_submenu_page(
37 37
 			'wl_admin_menu',
38
-			__( 'Exclude Include URLs', 'wordlift' ),
39
-			__( 'Exclude Include URLs', 'wordlift' ),
38
+			__('Exclude Include URLs', 'wordlift'),
39
+			__('Exclude Include URLs', 'wordlift'),
40 40
 			'manage_options',
41 41
 			'wl_exclude_include_urls_menu',
42
-			array( $this, 'submenu_page_callback' )
42
+			array($this, 'submenu_page_callback')
43 43
 		);
44 44
 	}
45 45
 
@@ -47,56 +47,56 @@  discard block
 block discarded – undo
47 47
 	 * Register settings.
48 48
 	 */
49 49
 	public function register_setting() {
50
-		register_setting( 'wl_exclude_include_urls_settings_group', 'wl_exclude_include_urls_settings' );
50
+		register_setting('wl_exclude_include_urls_settings_group', 'wl_exclude_include_urls_settings');
51 51
 		add_settings_section(
52 52
 			'wl_exclude_include_urls_settings_section_0',
53
-			__( 'URL filter type, list of URLs', 'wordlift' ),
54
-			array( $this, 'settings_section_callback' ),
53
+			__('URL filter type, list of URLs', 'wordlift'),
54
+			array($this, 'settings_section_callback'),
55 55
 			'wl_exclude_include_urls_settings_page'
56 56
 		);
57 57
 
58 58
 		add_settings_field(
59 59
 			'wl_exclude_include_urls_field_0',
60
-			__( 'URLs filter type', 'wordlift' ),
61
-			array( $this, 'settings_field_0_render' ),
60
+			__('URLs filter type', 'wordlift'),
61
+			array($this, 'settings_field_0_render'),
62 62
 			'wl_exclude_include_urls_settings_page',
63 63
 			'wl_exclude_include_urls_settings_section_0'
64 64
 		);
65 65
 
66 66
 		add_settings_field(
67 67
 			'wl_exclude_include_urls_field_1',
68
-			__( 'List of URLs', 'wordlift' ),
69
-			array( $this, 'settings_field_1_render' ),
68
+			__('List of URLs', 'wordlift'),
69
+			array($this, 'settings_field_1_render'),
70 70
 			'wl_exclude_include_urls_settings_page',
71 71
 			'wl_exclude_include_urls_settings_section_0'
72 72
 		);
73 73
 	}
74 74
 
75 75
 	public function settings_section_callback() {
76
-		echo esc_html__( 'Select a URL filter type, and add list of URLs to selective active from WordLift\'s JSON-LD', 'wordlift' );
76
+		echo esc_html__('Select a URL filter type, and add list of URLs to selective active from WordLift\'s JSON-LD', 'wordlift');
77 77
 	}
78 78
 
79 79
 	/**
80 80
 	 * Callback function for settings field rendering.
81 81
 	 */
82 82
 	public function settings_field_0_render() {
83
-		$options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore
84
-		include plugin_dir_path( __FILE__ ) . 'partials/field-0.php';
83
+		$options = get_option('wl_exclude_include_urls_settings'); // phpcs:ignore
84
+		include plugin_dir_path(__FILE__).'partials/field-0.php';
85 85
 	}
86 86
 
87 87
 	/**
88 88
 	 * Callback function for settings field rendering.
89 89
 	 */
90 90
 	public function settings_field_1_render() {
91
-		$options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore
92
-		include plugin_dir_path( __FILE__ ) . 'partials/field-1.php';
91
+		$options = get_option('wl_exclude_include_urls_settings'); // phpcs:ignore
92
+		include plugin_dir_path(__FILE__).'partials/field-1.php';
93 93
 	}
94 94
 
95 95
 	/**
96 96
 	 * Callback function for Exclude Include URLs submenu page.
97 97
 	 */
98 98
 	public function submenu_page_callback() {
99
-		include plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php';
99
+		include plugin_dir_path(__FILE__).'partials/exclude-include-urls-page.php';
100 100
 	}
101 101
 
102 102
 }
Please login to merge, or discard this patch.
src/modules/include-exclude/vendor/autoload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,6 +7,6 @@
 block discarded – undo
7 7
     exit(1);
8 8
 }
9 9
 
10
-require_once __DIR__ . '/composer/autoload_real.php';
10
+require_once __DIR__.'/composer/autoload_real.php';
11 11
 
12 12
 return ComposerAutoloaderInitea9f09a268eac98657b6e4638a5b4856::getLoader();
Please login to merge, or discard this patch.
src/modules/include-exclude/vendor/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = dirname($vendorDir);
7 7
 
8 8
 return array(
9
-    'Wordlift\\Modules\\Include_Exclude\\' => array($baseDir . '/includes'),
9
+    'Wordlift\\Modules\\Include_Exclude\\' => array($baseDir.'/includes'),
10 10
 );
Please login to merge, or discard this patch.
src/modules/include-exclude/vendor/composer/ClassLoader.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function getPrefixes()
115 115
     {
116
-        if (!empty($this->prefixesPsr0)) {
116
+        if ( ! empty($this->prefixesPsr0)) {
117 117
             return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
118 118
         }
119 119
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function add($prefix, $paths, $prepend = false)
185 185
     {
186
-        if (!$prefix) {
186
+        if ( ! $prefix) {
187 187
             if ($prepend) {
188 188
                 $this->fallbackDirsPsr0 = array_merge(
189 189
                     (array) $paths,
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         }
201 201
 
202 202
         $first = $prefix[0];
203
-        if (!isset($this->prefixesPsr0[$first][$prefix])) {
203
+        if ( ! isset($this->prefixesPsr0[$first][$prefix])) {
204 204
             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
205 205
 
206 206
             return;
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      */
233 233
     public function addPsr4($prefix, $paths, $prepend = false)
234 234
     {
235
-        if (!$prefix) {
235
+        if ( ! $prefix) {
236 236
             // Register directories for the root namespace.
237 237
             if ($prepend) {
238 238
                 $this->fallbackDirsPsr4 = array_merge(
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                     (array) $paths
246 246
                 );
247 247
             }
248
-        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
248
+        } elseif ( ! isset($this->prefixDirsPsr4[$prefix])) {
249 249
             // Register directories for a new namespace.
250 250
             $length = strlen($prefix);
251 251
             if ('\\' !== $prefix[$length - 1]) {
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      */
280 280
     public function set($prefix, $paths)
281 281
     {
282
-        if (!$prefix) {
282
+        if ( ! $prefix) {
283 283
             $this->fallbackDirsPsr0 = (array) $paths;
284 284
         } else {
285 285
             $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
      */
300 300
     public function setPsr4($prefix, $paths)
301 301
     {
302
-        if (!$prefix) {
302
+        if ( ! $prefix) {
303 303
             $this->fallbackDirsPsr4 = (array) $paths;
304 304
         } else {
305 305
             $length = strlen($prefix);
@@ -493,18 +493,18 @@  discard block
 block discarded – undo
493 493
     private function findFileWithExtension($class, $ext)
494 494
     {
495 495
         // PSR-4 lookup
496
-        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
496
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext;
497 497
 
498 498
         $first = $class[0];
499 499
         if (isset($this->prefixLengthsPsr4[$first])) {
500 500
             $subPath = $class;
501 501
             while (false !== $lastPos = strrpos($subPath, '\\')) {
502 502
                 $subPath = substr($subPath, 0, $lastPos);
503
-                $search = $subPath . '\\';
503
+                $search = $subPath.'\\';
504 504
                 if (isset($this->prefixDirsPsr4[$search])) {
505
-                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
505
+                    $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1);
506 506
                     foreach ($this->prefixDirsPsr4[$search] as $dir) {
507
-                        if (file_exists($file = $dir . $pathEnd)) {
507
+                        if (file_exists($file = $dir.$pathEnd)) {
508 508
                             return $file;
509 509
                         }
510 510
                     }
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 
515 515
         // PSR-4 fallback dirs
516 516
         foreach ($this->fallbackDirsPsr4 as $dir) {
517
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
517
+            if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) {
518 518
                 return $file;
519 519
             }
520 520
         }
@@ -526,14 +526,14 @@  discard block
 block discarded – undo
526 526
                 . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
527 527
         } else {
528 528
             // PEAR-like class name
529
-            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
529
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext;
530 530
         }
531 531
 
532 532
         if (isset($this->prefixesPsr0[$first])) {
533 533
             foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
534 534
                 if (0 === strpos($class, $prefix)) {
535 535
                     foreach ($dirs as $dir) {
536
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
536
+                        if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) {
537 537
                             return $file;
538 538
                         }
539 539
                     }
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 
544 544
         // PSR-0 fallback dirs
545 545
         foreach ($this->fallbackDirsPsr0 as $dir) {
546
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
546
+            if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) {
547 547
                 return $file;
548 548
             }
549 549
         }
Please login to merge, or discard this patch.