Completed
Push — master ( 4ae542...e8923b )
by David
01:25 queued 13s
created
src/admin/partials/admin-setup/step-6.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <!-- Pane 6 content -->
2 2
 <script type="text/html" id="page-5">
3 3
 	<h2 class="page-title">
4
-		<?php esc_html_e( 'Publisher', 'wordlift' ); ?>	
4
+		<?php esc_html_e('Publisher', 'wordlift'); ?>	
5 5
 	</h2>
6 6
 
7 7
 	<p class="page-txt">
8
-		<?php esc_html_e( 'Are you going to publish as an individual or as a company?', 'wordlift' ); ?>
8
+		<?php esc_html_e('Are you going to publish as an individual or as a company?', 'wordlift'); ?>
9 9
 	</p>
10 10
 
11 11
 	<div class="radio-wrapper">
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 			<span class="radio"><span class="check"></span></span>
21 21
 
22 22
 			<span class="label">
23
-				<?php esc_html_e( 'Personal', 'wordlift' ); ?>	
23
+				<?php esc_html_e('Personal', 'wordlift'); ?>	
24 24
 			</span>
25 25
 		</label>
26 26
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 			<span class="radio"><span class="check"></span></span>
36 36
 
37 37
 			<span class="label">
38
-				<?php esc_html_e( 'Company', 'wordlift' ); ?>
38
+				<?php esc_html_e('Company', 'wordlift'); ?>
39 39
 			</span>
40 40
 		</label>
41 41
 	</div>
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		value=""
48 48
 		autocomplete="off"
49 49
 		class="untouched invalid"
50
-		placeholder="<?php esc_attr_e( "What's your name?", 'wordlift' ); ?>"
50
+		placeholder="<?php esc_attr_e("What's your name?", 'wordlift'); ?>"
51 51
 	>
52 52
 
53 53
 	<div data-wl-logo="wl-logo">
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			class="add-logo"
66 66
 			href="javascript:void(0);"
67 67
 		>
68
-			<?php esc_html_e( 'Add your logo', 'wordlift' ); ?>
68
+			<?php esc_html_e('Add your logo', 'wordlift'); ?>
69 69
 		</a>
70 70
 	</div>
71 71
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 			type="submit"
75 75
 			id="btn-finish"
76 76
 			class="wl-default-action"
77
-			value="<?php esc_attr_e( 'Finish', 'wordlift' ); ?>"
77
+			value="<?php esc_attr_e('Finish', 'wordlift'); ?>"
78 78
 		>
79 79
 	</div>
80 80
 </script>
Please login to merge, or discard this patch.
src/install/class-wordlift-install.php 2 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -18,63 +18,63 @@
 block discarded – undo
18 18
  */
19 19
 abstract class Wordlift_Install {
20 20
 
21
-	/**
22
-	 * A {@link Wordlift_Log_Service} instance.
23
-	 *
24
-	 * @since  3.18.0
25
-	 * @access private
26
-	 * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance.
27
-	 */
28
-	protected $log;
21
+    /**
22
+     * A {@link Wordlift_Log_Service} instance.
23
+     *
24
+     * @since  3.18.0
25
+     * @access private
26
+     * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance.
27
+     */
28
+    protected $log;
29 29
 
30
-	/**
31
-	 * The default install version. Overridden by the installation packages.
32
-	 *
33
-	 * @since 3.18.0
34
-	 * @access protected
35
-	 * @var string $version The install version.
36
-	 */
37
-	protected static $version = '0.0.0';
30
+    /**
31
+     * The default install version. Overridden by the installation packages.
32
+     *
33
+     * @since 3.18.0
34
+     * @access protected
35
+     * @var string $version The install version.
36
+     */
37
+    protected static $version = '0.0.0';
38 38
 
39
-	/**
40
-	 * Wordlift_Install_Service constructor.
41
-	 *
42
-	 * @since 3.18.0
43
-	 */
44
-	public function __construct() {
39
+    /**
40
+     * Wordlift_Install_Service constructor.
41
+     *
42
+     * @since 3.18.0
43
+     */
44
+    public function __construct() {
45 45
 
46
-		$this->log = Wordlift_Log_Service::get_logger( get_class( $this ) );
46
+        $this->log = Wordlift_Log_Service::get_logger( get_class( $this ) );
47 47
 
48
-	}
48
+    }
49 49
 
50
-	/**
51
-	 * Return the current version of the installation.
52
-	 *
53
-	 * @since 3.18.0
54
-	 */
55
-	public function get_version() {
56
-		return static::$version;
57
-	}
50
+    /**
51
+     * Return the current version of the installation.
52
+     *
53
+     * @since 3.18.0
54
+     */
55
+    public function get_version() {
56
+        return static::$version;
57
+    }
58 58
 
59
-	/**
60
-	 * Run the install procedure. This function must be implemented by superclasses.
61
-	 *
62
-	 * @since 3.18.0
63
-	 *
64
-	 * @return mixed The result.
65
-	 */
66
-	abstract public function install();
59
+    /**
60
+     * Run the install procedure. This function must be implemented by superclasses.
61
+     *
62
+     * @since 3.18.0
63
+     *
64
+     * @return mixed The result.
65
+     */
66
+    abstract public function install();
67 67
 
68
-	/**
69
-	 * A custom procedure run by the caller to determine whether the install procedure must be run.
70
-	 *
71
-	 * @since 3.20.0
72
-	 *
73
-	 * @return bool True if the procedure must run.
74
-	 */
75
-	public function must_install() {
68
+    /**
69
+     * A custom procedure run by the caller to determine whether the install procedure must be run.
70
+     *
71
+     * @since 3.20.0
72
+     *
73
+     * @return bool True if the procedure must run.
74
+     */
75
+    public function must_install() {
76 76
 
77
-		return false;
78
-	}
77
+        return false;
78
+    }
79 79
 
80 80
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 	 */
44 44
 	public function __construct() {
45 45
 
46
-		$this->log = Wordlift_Log_Service::get_logger( get_class( $this ) );
46
+		$this->log = Wordlift_Log_Service::get_logger(get_class($this));
47 47
 
48 48
 	}
49 49
 
Please login to merge, or discard this patch.
src/install/class-wordlift-install-3-19-5.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,23 +16,23 @@
 block discarded – undo
16 16
  */
17 17
 class Wordlift_Install_3_19_5 extends Wordlift_Install {
18 18
 
19
-	/**
20
-	 * {@inheritdoc}
21
-	 */
22
-	protected static $version = '3.19.5';
19
+    /**
20
+     * {@inheritdoc}
21
+     */
22
+    protected static $version = '3.19.5';
23 23
 
24
-	/**
25
-	 * {@inheritdoc}
26
-	 */
27
-	public function install() {
24
+    /**
25
+     * {@inheritdoc}
26
+     */
27
+    public function install() {
28 28
 
29
-		/*
29
+        /*
30 30
 		 * Flush all the caches, since we changed some JSON-LD publishing rules.
31 31
 		 *
32 32
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/858
33 33
 		 */
34
-		Wordlift_File_Cache_Service::flush_all();
34
+        Wordlift_File_Cache_Service::flush_all();
35 35
 
36
-	}
36
+    }
37 37
 
38 38
 }
Please login to merge, or discard this patch.
src/install/class-wordlift-install-package-type.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 		$key                   = $configuration_service->get_key();
37 37
 
38 38
 		// Bail out if the `key` isn't set.
39
-		if ( empty( $key ) ) {
39
+		if (empty($key)) {
40 40
 			return;
41 41
 		}
42 42
 
43 43
 		// Calling this function will get and set the remote dataset and package type.
44
-		$configuration_service->get_remote_dataset_uri( $key );
44
+		$configuration_service->get_remote_dataset_uri($key);
45 45
 
46 46
 	}
47 47
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		$package_type          = $configuration_service->get_package_type();
61 61
 
62 62
 		// We need to determine the package type if the `key` is set, but the `package_type` isn't.
63
-		return is_admin() && ! empty( $key ) && empty( $package_type );
63
+		return is_admin() && ! empty($key) && empty($package_type);
64 64
 	}
65 65
 
66 66
 }
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -16,51 +16,51 @@
 block discarded – undo
16 16
  */
17 17
 class Wordlift_Install_Package_Type extends Wordlift_Install {
18 18
 
19
-	/**
20
-	 * The install version.
21
-	 *
22
-	 * @since 3.20.0
23
-	 */
24
-	protected static $version = '3.20.0';
19
+    /**
20
+     * The install version.
21
+     *
22
+     * @since 3.20.0
23
+     */
24
+    protected static $version = '3.20.0';
25 25
 
26
-	/**
27
-	 * Run the install procedure.
28
-	 *
29
-	 * @since 3.20.0
30
-	 *
31
-	 * @return mixed The result.
32
-	 */
33
-	public function install() {
26
+    /**
27
+     * Run the install procedure.
28
+     *
29
+     * @since 3.20.0
30
+     *
31
+     * @return mixed The result.
32
+     */
33
+    public function install() {
34 34
 
35
-		$configuration_service = Wordlift_Configuration_Service::get_instance();
36
-		$key                   = $configuration_service->get_key();
35
+        $configuration_service = Wordlift_Configuration_Service::get_instance();
36
+        $key                   = $configuration_service->get_key();
37 37
 
38
-		// Bail out if the `key` isn't set.
39
-		if ( empty( $key ) ) {
40
-			return;
41
-		}
38
+        // Bail out if the `key` isn't set.
39
+        if ( empty( $key ) ) {
40
+            return;
41
+        }
42 42
 
43
-		// Calling this function will get and set the remote dataset and package type.
44
-		$configuration_service->get_remote_dataset_uri( $key );
43
+        // Calling this function will get and set the remote dataset and package type.
44
+        $configuration_service->get_remote_dataset_uri( $key );
45 45
 
46
-	}
46
+    }
47 47
 
48
-	/**
49
-	 * Must install when the package type isn't set.
50
-	 *
51
-	 * See https://github.com/insideout10/wordlift-plugin/issues/761
52
-	 *
53
-	 * @since 3.20.0
54
-	 * @return bool True if package type is set, otherwise false.
55
-	 */
56
-	public function must_install() {
48
+    /**
49
+     * Must install when the package type isn't set.
50
+     *
51
+     * See https://github.com/insideout10/wordlift-plugin/issues/761
52
+     *
53
+     * @since 3.20.0
54
+     * @return bool True if package type is set, otherwise false.
55
+     */
56
+    public function must_install() {
57 57
 
58
-		$configuration_service = Wordlift_Configuration_Service::get_instance();
59
-		$key                   = $configuration_service->get_key();
60
-		$package_type          = $configuration_service->get_package_type();
58
+        $configuration_service = Wordlift_Configuration_Service::get_instance();
59
+        $key                   = $configuration_service->get_key();
60
+        $package_type          = $configuration_service->get_package_type();
61 61
 
62
-		// We need to determine the package type if the `key` is set, but the `package_type` isn't.
63
-		return is_admin() && ! empty( $key ) && empty( $package_type );
64
-	}
62
+        // We need to determine the package type if the `key` is set, but the `package_type` isn't.
63
+        return is_admin() && ! empty( $key ) && empty( $package_type );
64
+    }
65 65
 
66 66
 }
Please login to merge, or discard this patch.
src/includes/batch/intf-wordlift-batch-operation.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -15,32 +15,32 @@
 block discarded – undo
15 15
  */
16 16
 interface Wordlift_Batch_Operation_Interface {
17 17
 
18
-	/**
19
-	 * Process the batch operation starting from the specified offset.
20
-	 *
21
-	 * @since 3.20.0
22
-	 *
23
-	 * @param int $offset Start from the specified offset (or 0 if not specified).
24
-	 * @param int $limit Process the specified amount of items per call (or 10 if not specified).
25
-	 *
26
-	 * @return array {
27
-	 * The operation result.
28
-	 *
29
-	 * @type int  $next The next offset.
30
-	 * @type int  $limit The amount of items to process per call.
31
-	 * @type int  $remaining The remaining number of elements to process.
32
-	 * @type bool $complete Whether the operation completed.
33
-	 * }
34
-	 */
35
-	public function process( $offset = 0, $limit = 10 );
18
+    /**
19
+     * Process the batch operation starting from the specified offset.
20
+     *
21
+     * @since 3.20.0
22
+     *
23
+     * @param int $offset Start from the specified offset (or 0 if not specified).
24
+     * @param int $limit Process the specified amount of items per call (or 10 if not specified).
25
+     *
26
+     * @return array {
27
+     * The operation result.
28
+     *
29
+     * @type int  $next The next offset.
30
+     * @type int  $limit The amount of items to process per call.
31
+     * @type int  $remaining The remaining number of elements to process.
32
+     * @type bool $complete Whether the operation completed.
33
+     * }
34
+     */
35
+    public function process( $offset = 0, $limit = 10 );
36 36
 
37
-	/**
38
-	 * Count the number of elements that would be affected by the operation.
39
-	 *
40
-	 * @since 3.20.0
41
-	 *
42
-	 * @return int The number of elements that would be affected.
43
-	 */
44
-	public function count();
37
+    /**
38
+     * Count the number of elements that would be affected by the operation.
39
+     *
40
+     * @since 3.20.0
41
+     *
42
+     * @return int The number of elements that would be affected.
43
+     */
44
+    public function count();
45 45
 
46 46
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	 * @type bool $complete Whether the operation completed.
33 33
 	 * }
34 34
 	 */
35
-	public function process( $offset = 0, $limit = 10 );
35
+	public function process($offset = 0, $limit = 10);
36 36
 
37 37
 	/**
38 38
 	 * Count the number of elements that would be affected by the operation.
Please login to merge, or discard this patch.
src/includes/linked-data/storage/class-wordlift-post-property-storage.php 2 patches
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -18,75 +18,75 @@
 block discarded – undo
18 18
  */
19 19
 class Wordlift_Post_Property_Storage extends Wordlift_Storage {
20 20
 
21
-	/**
22
-	 * The `post_title` property.
23
-	 */
24
-	const TITLE = 'title';
25
-
26
-	/**
27
-	 * The `post_content` property stripped of tags and shortcodes.
28
-	 */
29
-	const DESCRIPTION_NO_TAGS_NO_SHORTCODES = 'description_no_tags_no_shortcodes';
30
-
31
-	/**
32
-	 * The `post_author` property.
33
-	 */
34
-	const AUTHOR = 'author';
35
-
36
-	/**
37
-	 * The {@link WP_Post} property to retrieve.
38
-	 *
39
-	 * @since  3.15.0
40
-	 * @access private
41
-	 * @var string $property The {@link WP_Post} property to retrieve.
42
-	 */
43
-	private $property;
44
-
45
-	/**
46
-	 * Create a {@link Wordlift_Post_Property_Storage} instance.
47
-	 *
48
-	 * @since 3.15.0
49
-	 *
50
-	 * @param string $property A post property.
51
-	 */
52
-	public function __construct( $property ) {
53
-
54
-		$this->property = $property;
55
-
56
-	}
57
-
58
-	/**
59
-	 * Get the property value.
60
-	 *
61
-	 * @since 3.15.0
62
-	 *
63
-	 * @param int $post_id The {@link WP_Post}'s id.
64
-	 *
65
-	 * @return array|string|null A single string, or an array of values or null
66
-	 *                           if the property isn't recognized.
67
-	 */
68
-	public function get( $post_id ) {
69
-
70
-		// Get the post.
71
-		$post = get_post( $post_id );
72
-
73
-		// Switch according to the selected property.
74
-		switch ( $this->property ) {
75
-
76
-			// Title.
77
-			case self::TITLE:
78
-				return $post->post_title;
79
-
80
-			// Description.
81
-			case self::DESCRIPTION_NO_TAGS_NO_SHORTCODES:
82
-				return wp_strip_all_tags( preg_replace( '/\[[^]]+\]/', '', do_shortcode( $post->post_content ) ) );
83
-
84
-			// Author.
85
-			case self::AUTHOR:
86
-				return $post->post_author;
87
-		}
88
-
89
-		return null;
90
-	}
21
+    /**
22
+     * The `post_title` property.
23
+     */
24
+    const TITLE = 'title';
25
+
26
+    /**
27
+     * The `post_content` property stripped of tags and shortcodes.
28
+     */
29
+    const DESCRIPTION_NO_TAGS_NO_SHORTCODES = 'description_no_tags_no_shortcodes';
30
+
31
+    /**
32
+     * The `post_author` property.
33
+     */
34
+    const AUTHOR = 'author';
35
+
36
+    /**
37
+     * The {@link WP_Post} property to retrieve.
38
+     *
39
+     * @since  3.15.0
40
+     * @access private
41
+     * @var string $property The {@link WP_Post} property to retrieve.
42
+     */
43
+    private $property;
44
+
45
+    /**
46
+     * Create a {@link Wordlift_Post_Property_Storage} instance.
47
+     *
48
+     * @since 3.15.0
49
+     *
50
+     * @param string $property A post property.
51
+     */
52
+    public function __construct( $property ) {
53
+
54
+        $this->property = $property;
55
+
56
+    }
57
+
58
+    /**
59
+     * Get the property value.
60
+     *
61
+     * @since 3.15.0
62
+     *
63
+     * @param int $post_id The {@link WP_Post}'s id.
64
+     *
65
+     * @return array|string|null A single string, or an array of values or null
66
+     *                           if the property isn't recognized.
67
+     */
68
+    public function get( $post_id ) {
69
+
70
+        // Get the post.
71
+        $post = get_post( $post_id );
72
+
73
+        // Switch according to the selected property.
74
+        switch ( $this->property ) {
75
+
76
+            // Title.
77
+            case self::TITLE:
78
+                return $post->post_title;
79
+
80
+            // Description.
81
+            case self::DESCRIPTION_NO_TAGS_NO_SHORTCODES:
82
+                return wp_strip_all_tags( preg_replace( '/\[[^]]+\]/', '', do_shortcode( $post->post_content ) ) );
83
+
84
+            // Author.
85
+            case self::AUTHOR:
86
+                return $post->post_author;
87
+        }
88
+
89
+        return null;
90
+    }
91 91
 
92 92
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @param string $property A post property.
51 51
 	 */
52
-	public function __construct( $property ) {
52
+	public function __construct($property) {
53 53
 
54 54
 		$this->property = $property;
55 55
 
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 	 * @return array|string|null A single string, or an array of values or null
66 66
 	 *                           if the property isn't recognized.
67 67
 	 */
68
-	public function get( $post_id ) {
68
+	public function get($post_id) {
69 69
 
70 70
 		// Get the post.
71
-		$post = get_post( $post_id );
71
+		$post = get_post($post_id);
72 72
 
73 73
 		// Switch according to the selected property.
74
-		switch ( $this->property ) {
74
+		switch ($this->property) {
75 75
 
76 76
 			// Title.
77 77
 			case self::TITLE:
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
 			// Description.
81 81
 			case self::DESCRIPTION_NO_TAGS_NO_SHORTCODES:
82
-				return wp_strip_all_tags( preg_replace( '/\[[^]]+\]/', '', do_shortcode( $post->post_content ) ) );
82
+				return wp_strip_all_tags(preg_replace('/\[[^]]+\]/', '', do_shortcode($post->post_content)));
83 83
 
84 84
 			// Author.
85 85
 			case self::AUTHOR:
Please login to merge, or discard this patch.
src/wordlift/http/class-simple-http-client.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@
 block discarded – undo
10 10
  */
11 11
 class Simple_Http_Client implements Http_Client {
12 12
 
13
-	/**
14
-	 * @inheritDoc
15
-	 */
16
-	public function get( $url, $options = array() ) {
13
+    /**
14
+     * @inheritDoc
15
+     */
16
+    public function get( $url, $options = array() ) {
17 17
 
18
-		$options['method'] = 'GET';
18
+        $options['method'] = 'GET';
19 19
 
20
-		return $this->request( $url, $options );
21
-	}
20
+        return $this->request( $url, $options );
21
+    }
22 22
 
23
-	/**
24
-	 * @inheritDoc
25
-	 */
26
-	public function request( $url, $options = array() ) {
23
+    /**
24
+     * @inheritDoc
25
+     */
26
+    public function request( $url, $options = array() ) {
27 27
 
28
-		return wp_remote_request( $url, $options );
29
-	}
28
+        return wp_remote_request( $url, $options );
29
+    }
30 30
 
31 31
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@
 block discarded – undo
13 13
 	/**
14 14
 	 * @inheritDoc
15 15
 	 */
16
-	public function get( $url, $options = array() ) {
16
+	public function get($url, $options = array()) {
17 17
 
18 18
 		$options['method'] = 'GET';
19 19
 
20
-		return $this->request( $url, $options );
20
+		return $this->request($url, $options);
21 21
 	}
22 22
 
23 23
 	/**
24 24
 	 * @inheritDoc
25 25
 	 */
26
-	public function request( $url, $options = array() ) {
26
+	public function request($url, $options = array()) {
27 27
 
28
-		return wp_remote_request( $url, $options );
28
+		return wp_remote_request($url, $options);
29 29
 	}
30 30
 
31 31
 }
Please login to merge, or discard this patch.
src/includes/class-wordlift-post-excerpt-helper.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 *
39 39
 	 * @return string The excerpt.
40 40
 	 */
41
-	public static function get_text_excerpt( $post, $length = 55, $more = '...' ) {
41
+	public static function get_text_excerpt($post, $length = 55, $more = '...') {
42 42
 
43 43
 		/*
44 44
 		 * Apply the `wl_post_content` filter, in case 3rd parties want to change the post content, e.g.
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
 		 *
47 47
 		 * @since 3.20.0
48 48
 		 */
49
-		$post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
49
+		$post_content = apply_filters('wl_post_content', $post->post_content, $post);
50 50
 
51 51
 		// Filter shortcode content in post_content, before using it for trimming
52
-		$post_content = do_shortcode( $post_content );
52
+		$post_content = do_shortcode($post_content);
53 53
 
54 54
 		// Get the excerpt and trim it. Use the `post_excerpt` if available.
55
-		$excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more );
55
+		$excerpt = wp_trim_words( ! empty($post->post_excerpt) ? $post->post_excerpt : $post_content, $length, $more);
56 56
 
57 57
 		// Remove shortcodes and decode html entities.
58
-		return html_entity_decode( self::strip_all_shortcodes( $excerpt ) );
58
+		return html_entity_decode(self::strip_all_shortcodes($excerpt));
59 59
 	}
60 60
 
61 61
 	/**
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 *
70 70
 	 * @return string The content without shortcodes.
71 71
 	 */
72
-	private static function strip_all_shortcodes( $content ) {
72
+	private static function strip_all_shortcodes($content) {
73 73
 
74
-		return preg_replace( '/\[[^]]+\]/', '', $content );
74
+		return preg_replace('/\[[^]]+\]/', '', $content);
75 75
 	}
76 76
 
77 77
 }
Please login to merge, or discard this patch.
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -23,55 +23,55 @@
 block discarded – undo
23 23
  */
24 24
 class Wordlift_Post_Excerpt_Helper {
25 25
 
26
-	/**
27
-	 * Get the text excerpt for the provided {@link WP_Post}.
28
-	 *
29
-	 * Since anyone can hook on the excerpt generation filters, and
30
-	 * amend it with non textual content, we play it self and generate
31
-	 * the excerpt ourselves, mimicking the way WordPress core does it.
32
-	 *
33
-	 * @since 3.10.0
34
-	 *
35
-	 * @param WP_Post $post The {@link WP_Post}.
36
-	 * @param int     $length The desired excerpt length.
37
-	 * @param string  $more The desired more string.
38
-	 *
39
-	 * @return string The excerpt.
40
-	 */
41
-	public static function get_text_excerpt( $post, $length = 55, $more = '...' ) {
26
+    /**
27
+     * Get the text excerpt for the provided {@link WP_Post}.
28
+     *
29
+     * Since anyone can hook on the excerpt generation filters, and
30
+     * amend it with non textual content, we play it self and generate
31
+     * the excerpt ourselves, mimicking the way WordPress core does it.
32
+     *
33
+     * @since 3.10.0
34
+     *
35
+     * @param WP_Post $post The {@link WP_Post}.
36
+     * @param int     $length The desired excerpt length.
37
+     * @param string  $more The desired more string.
38
+     *
39
+     * @return string The excerpt.
40
+     */
41
+    public static function get_text_excerpt( $post, $length = 55, $more = '...' ) {
42 42
 
43
-		/*
43
+        /*
44 44
 		 * Apply the `wl_post_content` filter, in case 3rd parties want to change the post content, e.g.
45 45
 		 * because the content is written elsewhere.
46 46
 		 *
47 47
 		 * @since 3.20.0
48 48
 		 */
49
-		$post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
49
+        $post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
50 50
 
51
-		// Filter shortcode content in post_content, before using it for trimming
52
-		$post_content = do_shortcode( $post_content );
51
+        // Filter shortcode content in post_content, before using it for trimming
52
+        $post_content = do_shortcode( $post_content );
53 53
 
54
-		// Get the excerpt and trim it. Use the `post_excerpt` if available.
55
-		$excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more );
54
+        // Get the excerpt and trim it. Use the `post_excerpt` if available.
55
+        $excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more );
56 56
 
57
-		// Remove shortcodes and decode html entities.
58
-		return html_entity_decode( self::strip_all_shortcodes( $excerpt ) );
59
-	}
57
+        // Remove shortcodes and decode html entities.
58
+        return html_entity_decode( self::strip_all_shortcodes( $excerpt ) );
59
+    }
60 60
 
61
-	/**
62
-	 * Remove all the shortcodes from the content. We're using our own function
63
-	 * because WordPress' own `strip_shortcodes` only takes into consideration
64
-	 * shortcodes for installed plugins/themes.
65
-	 *
66
-	 * @since 3.12.0
67
-	 *
68
-	 * @param string $content The content with shortcodes.
69
-	 *
70
-	 * @return string The content without shortcodes.
71
-	 */
72
-	private static function strip_all_shortcodes( $content ) {
61
+    /**
62
+     * Remove all the shortcodes from the content. We're using our own function
63
+     * because WordPress' own `strip_shortcodes` only takes into consideration
64
+     * shortcodes for installed plugins/themes.
65
+     *
66
+     * @since 3.12.0
67
+     *
68
+     * @param string $content The content with shortcodes.
69
+     *
70
+     * @return string The content without shortcodes.
71
+     */
72
+    private static function strip_all_shortcodes( $content ) {
73 73
 
74
-		return preg_replace( '/\[[^]]+\]/', '', $content );
75
-	}
74
+        return preg_replace( '/\[[^]]+\]/', '', $content );
75
+    }
76 76
 
77 77
 }
Please login to merge, or discard this patch.
src/wordlift/autocomplete/class-autocomplete-service.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,6 +20,6 @@
 block discarded – undo
20 20
 	 *
21 21
 	 * @return array An array of results.
22 22
 	 */
23
-	public function query( $query, $scope, $excludes );
23
+	public function query($query, $scope, $excludes);
24 24
 
25 25
 }
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@
 block discarded – undo
11 11
 
12 12
 interface Autocomplete_Service {
13 13
 
14
-	/**
15
-	 * Query the service for the specified data.
16
-	 *
17
-	 * @param string          $query The query.
18
-	 * @param string          $scope The scope.
19
-	 * @param string|string[] $excludes URLs to exclude.
20
-	 *
21
-	 * @return array An array of results.
22
-	 */
23
-	public function query( $query, $scope, $excludes );
14
+    /**
15
+     * Query the service for the specified data.
16
+     *
17
+     * @param string          $query The query.
18
+     * @param string          $scope The scope.
19
+     * @param string|string[] $excludes URLs to exclude.
20
+     *
21
+     * @return array An array of results.
22
+     */
23
+    public function query( $query, $scope, $excludes );
24 24
 
25 25
 }
Please login to merge, or discard this patch.