Passed
Push — master ( 078281...45cbff )
by Paul
03:42
created
plugin/Commands/TogglePinned.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
 
5 5
 class TogglePinned
6 6
 {
7
-    public $id;
8
-    public $pinned;
7
+	public $id;
8
+	public $pinned;
9 9
 
10
-    public function __construct($input)
11
-    {
12
-        $this->id = $input['id'];
13
-        $this->pinned = isset($input['pinned'])
14
-            ? wp_validate_boolean($input['pinned'])
15
-            : null;
16
-    }
10
+	public function __construct($input)
11
+	{
12
+		$this->id = $input['id'];
13
+		$this->pinned = isset($input['pinned'])
14
+			? wp_validate_boolean($input['pinned'])
15
+			: null;
16
+	}
17 17
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
     public $id;
8 8
     public $pinned;
9 9
 
10
-    public function __construct($input)
10
+    public function __construct( $input )
11 11
     {
12 12
         $this->id = $input['id'];
13 13
         $this->pinned = isset($input['pinned'])
14
-            ? wp_validate_boolean($input['pinned'])
14
+            ? wp_validate_boolean( $input['pinned'] )
15 15
             : null;
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
plugin/Commands/RegisterWidgets.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class RegisterWidgets
6 6
 {
7
-    public $widgets;
7
+	public $widgets;
8 8
 
9
-    public function __construct($input)
10
-    {
11
-        $this->widgets = $input;
12
-    }
9
+	public function __construct($input)
10
+	{
11
+		$this->widgets = $input;
12
+	}
13 13
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
     public $widgets;
8 8
 
9
-    public function __construct($input)
9
+    public function __construct( $input )
10 10
     {
11 11
         $this->widgets = $input;
12 12
     }
Please login to merge, or discard this patch.
plugin/Commands/ChangeStatus.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
 
5 5
 class ChangeStatus
6 6
 {
7
-    public $id;
8
-    public $status;
7
+	public $id;
8
+	public $status;
9 9
 
10
-    public function __construct($input)
11
-    {
12
-        $this->id = $input['post_id'];
13
-        $this->status = 'approve' == $input['status']
14
-            ? 'publish'
15
-            : 'pending';
16
-    }
10
+	public function __construct($input)
11
+	{
12
+		$this->id = $input['post_id'];
13
+		$this->status = 'approve' == $input['status']
14
+			? 'publish'
15
+			: 'pending';
16
+	}
17 17
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
     public $id;
8 8
     public $status;
9 9
 
10
-    public function __construct($input)
10
+    public function __construct( $input )
11 11
     {
12 12
         $this->id = $input['post_id'];
13 13
         $this->status = 'approve' == $input['status']
Please login to merge, or discard this patch.
plugin/Commands/RegisterTinymcePopups.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class RegisterTinymcePopups
6 6
 {
7
-    public $popups;
7
+	public $popups;
8 8
 
9
-    public function __construct($input)
10
-    {
11
-        $this->popups = $input;
12
-    }
9
+	public function __construct($input)
10
+	{
11
+		$this->popups = $input;
12
+	}
13 13
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
     public $popups;
8 8
 
9
-    public function __construct($input)
9
+    public function __construct( $input )
10 10
     {
11 11
         $this->popups = $input;
12 12
     }
Please login to merge, or discard this patch.
plugin/Commands/RegisterTaxonomy.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class RegisterTaxonomy
6 6
 {
7
-    public $args;
7
+	public $args;
8 8
 
9
-    public function __construct($input)
10
-    {
11
-        $this->args = $input;
12
-    }
9
+	public function __construct($input)
10
+	{
11
+		$this->args = $input;
12
+	}
13 13
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
     public $args;
8 8
 
9
-    public function __construct($input)
9
+    public function __construct( $input )
10 10
     {
11 11
         $this->args = $input;
12 12
     }
Please login to merge, or discard this patch.
plugin/Commands/EnqueueAdminAssets.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class EnqueueAdminAssets
6 6
 {
7
-    public $pointers;
7
+	public $pointers;
8 8
 
9
-    public function __construct(array $input)
10
-    {
11
-        $this->pointers = $input['pointers'];
12
-    }
9
+	public function __construct(array $input)
10
+	{
11
+		$this->pointers = $input['pointers'];
12
+	}
13 13
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
     public $pointers;
8 8
 
9
-    public function __construct(array $input)
9
+    public function __construct( array $input )
10 10
     {
11 11
         $this->pointers = $input['pointers'];
12 12
     }
Please login to merge, or discard this patch.
plugin/Commands/RegisterShortcodes.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class RegisterShortcodes
6 6
 {
7
-    public $shortcodes;
7
+	public $shortcodes;
8 8
 
9
-    public function __construct($input)
10
-    {
11
-        $this->shortcodes = $input;
12
-    }
9
+	public function __construct($input)
10
+	{
11
+		$this->shortcodes = $input;
12
+	}
13 13
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
     public $shortcodes;
8 8
 
9
-    public function __construct($input)
9
+    public function __construct( $input )
10 10
     {
11 11
         $this->shortcodes = $input;
12 12
     }
Please login to merge, or discard this patch.
plugin/Database.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,8 @@
 block discarded – undo
116 116
         ];
117 117
         if (is_numeric($searchTerm)) {
118 118
             $args['post__in'] = [$searchTerm];
119
-        } else {
119
+        }
120
+        else {
120 121
             $args['orderby'] = 'relevance';
121 122
             $args['posts_per_page'] = 10;
122 123
             $args['s'] = $searchTerm;
Please login to merge, or discard this patch.
Indentation   +158 added lines, -158 removed lines patch added patch discarded remove patch
@@ -12,171 +12,171 @@
 block discarded – undo
12 12
 
13 13
 class Database
14 14
 {
15
-    /**
16
-     * @param int $postId
17
-     * @param string $key
18
-     * @param bool $single
19
-     * @return mixed
20
-     */
21
-    public function get($postId, $key, $single = true)
22
-    {
23
-        $key = Str::prefix('_', $key);
24
-        return get_post_meta(intval($postId), $key, $single);
25
-    }
15
+	/**
16
+	 * @param int $postId
17
+	 * @param string $key
18
+	 * @param bool $single
19
+	 * @return mixed
20
+	 */
21
+	public function get($postId, $key, $single = true)
22
+	{
23
+		$key = Str::prefix('_', $key);
24
+		return get_post_meta(intval($postId), $key, $single);
25
+	}
26 26
 
27
-    /**
28
-     * @param int $postId
29
-     * @param string $assignedTo
30
-     * @return void|WP_Post
31
-     */
32
-    public function getAssignedToPost($postId, $assignedTo = '')
33
-    {
34
-        if (empty($assignedTo)) {
35
-            $assignedTo = $this->get($postId, 'assigned_to');
36
-        }
37
-        if (empty($assignedTo)) {
38
-            return;
39
-        }
40
-        $assignedPost = get_post($assignedTo);
41
-        if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) {
42
-            return $assignedPost;
43
-        }
44
-    }
27
+	/**
28
+	 * @param int $postId
29
+	 * @param string $assignedTo
30
+	 * @return void|WP_Post
31
+	 */
32
+	public function getAssignedToPost($postId, $assignedTo = '')
33
+	{
34
+		if (empty($assignedTo)) {
35
+			$assignedTo = $this->get($postId, 'assigned_to');
36
+		}
37
+		if (empty($assignedTo)) {
38
+			return;
39
+		}
40
+		$assignedPost = get_post($assignedTo);
41
+		if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) {
42
+			return $assignedPost;
43
+		}
44
+	}
45 45
 
46
-    /**
47
-     * @param string $metaKey
48
-     * @param string $metaValue
49
-     * @return array|int
50
-     */
51
-    public function getReviewCount($metaKey = '', $metaValue = '')
52
-    {
53
-        if (!$metaKey) {
54
-            return (array) wp_count_posts(Application::POST_TYPE);
55
-        }
56
-        $counts = glsr(Cache::class)->getReviewCountsFor($metaKey);
57
-        if (!$metaValue) {
58
-            return $counts;
59
-        }
60
-        return Arr::get($counts, $metaValue, 0);
61
-    }
46
+	/**
47
+	 * @param string $metaKey
48
+	 * @param string $metaValue
49
+	 * @return array|int
50
+	 */
51
+	public function getReviewCount($metaKey = '', $metaValue = '')
52
+	{
53
+		if (!$metaKey) {
54
+			return (array) wp_count_posts(Application::POST_TYPE);
55
+		}
56
+		$counts = glsr(Cache::class)->getReviewCountsFor($metaKey);
57
+		if (!$metaValue) {
58
+			return $counts;
59
+		}
60
+		return Arr::get($counts, $metaValue, 0);
61
+	}
62 62
 
63
-    /**
64
-     * @param string $metaReviewType
65
-     * @return array
66
-     */
67
-    public function getReviewIdsByType($metaReviewType)
68
-    {
69
-        return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType);
70
-    }
63
+	/**
64
+	 * @param string $metaReviewType
65
+	 * @return array
66
+	 */
67
+	public function getReviewIdsByType($metaReviewType)
68
+	{
69
+		return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType);
70
+	}
71 71
 
72
-    /**
73
-     * @param string $key
74
-     * @param string $status
75
-     * @return array
76
-     */
77
-    public function getReviewsMeta($key, $status = 'publish')
78
-    {
79
-        if ('all' == $status || empty($status)) {
80
-            $status = get_post_stati(['exclude_from_search' => false]);
81
-        }
82
-        return glsr(SqlQueries::class)->getReviewsMeta($key, $status);
83
-    }
72
+	/**
73
+	 * @param string $key
74
+	 * @param string $status
75
+	 * @return array
76
+	 */
77
+	public function getReviewsMeta($key, $status = 'publish')
78
+	{
79
+		if ('all' == $status || empty($status)) {
80
+			$status = get_post_stati(['exclude_from_search' => false]);
81
+		}
82
+		return glsr(SqlQueries::class)->getReviewsMeta($key, $status);
83
+	}
84 84
 
85
-    /**
86
-     * @param string $field
87
-     * @return array
88
-     */
89
-    public function getTermIds(array $values, $field)
90
-    {
91
-        $termIds = [];
92
-        foreach ($values as $value) {
93
-            $term = get_term_by($field, $value, Application::TAXONOMY);
94
-            if (!isset($term->term_id)) {
95
-                continue;
96
-            }
97
-            $termIds[] = $term->term_id;
98
-        }
99
-        return $termIds;
100
-    }
85
+	/**
86
+	 * @param string $field
87
+	 * @return array
88
+	 */
89
+	public function getTermIds(array $values, $field)
90
+	{
91
+		$termIds = [];
92
+		foreach ($values as $value) {
93
+			$term = get_term_by($field, $value, Application::TAXONOMY);
94
+			if (!isset($term->term_id)) {
95
+				continue;
96
+			}
97
+			$termIds[] = $term->term_id;
98
+		}
99
+		return $termIds;
100
+	}
101 101
 
102
-    /**
103
-     * @return array
104
-     */
105
-    public function getTerms(array $args = [])
106
-    {
107
-        $args = wp_parse_args($args, [
108
-            'count' => false,
109
-            'fields' => 'id=>name',
110
-            'hide_empty' => false,
111
-            'taxonomy' => Application::TAXONOMY,
112
-        ]);
113
-        $terms = get_terms($args);
114
-        if (is_wp_error($terms)) {
115
-            glsr_log()->error($terms->get_error_message());
116
-            return [];
117
-        }
118
-        return $terms;
119
-    }
102
+	/**
103
+	 * @return array
104
+	 */
105
+	public function getTerms(array $args = [])
106
+	{
107
+		$args = wp_parse_args($args, [
108
+			'count' => false,
109
+			'fields' => 'id=>name',
110
+			'hide_empty' => false,
111
+			'taxonomy' => Application::TAXONOMY,
112
+		]);
113
+		$terms = get_terms($args);
114
+		if (is_wp_error($terms)) {
115
+			glsr_log()->error($terms->get_error_message());
116
+			return [];
117
+		}
118
+		return $terms;
119
+	}
120 120
 
121
-    /**
122
-     * @param string $searchTerm
123
-     * @return void|string
124
-     */
125
-    public function searchPosts($searchTerm)
126
-    {
127
-        $args = [
128
-            'post_status' => 'publish',
129
-            'post_type' => 'any',
130
-        ];
131
-        if (is_numeric($searchTerm)) {
132
-            $args['post__in'] = [$searchTerm];
133
-        } else {
134
-            $args['orderby'] = 'relevance';
135
-            $args['posts_per_page'] = 10;
136
-            $args['s'] = $searchTerm;
137
-        }
138
-        $queryBuilder = glsr(QueryBuilder::class);
139
-        add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2);
140
-        $search = new WP_Query($args);
141
-        remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500);
142
-        if (!$search->have_posts()) {
143
-            return;
144
-        }
145
-        $results = '';
146
-        while ($search->have_posts()) {
147
-            $search->the_post();
148
-            ob_start();
149
-            glsr()->render('partials/editor/search-result', [
150
-                'ID' => get_the_ID(),
151
-                'permalink' => esc_url((string) get_permalink()),
152
-                'title' => esc_attr(get_the_title()),
153
-            ]);
154
-            $results.= ob_get_clean();
155
-        }
156
-        wp_reset_postdata();
157
-        return $results;
158
-    }
121
+	/**
122
+	 * @param string $searchTerm
123
+	 * @return void|string
124
+	 */
125
+	public function searchPosts($searchTerm)
126
+	{
127
+		$args = [
128
+			'post_status' => 'publish',
129
+			'post_type' => 'any',
130
+		];
131
+		if (is_numeric($searchTerm)) {
132
+			$args['post__in'] = [$searchTerm];
133
+		} else {
134
+			$args['orderby'] = 'relevance';
135
+			$args['posts_per_page'] = 10;
136
+			$args['s'] = $searchTerm;
137
+		}
138
+		$queryBuilder = glsr(QueryBuilder::class);
139
+		add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2);
140
+		$search = new WP_Query($args);
141
+		remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500);
142
+		if (!$search->have_posts()) {
143
+			return;
144
+		}
145
+		$results = '';
146
+		while ($search->have_posts()) {
147
+			$search->the_post();
148
+			ob_start();
149
+			glsr()->render('partials/editor/search-result', [
150
+				'ID' => get_the_ID(),
151
+				'permalink' => esc_url((string) get_permalink()),
152
+				'title' => esc_attr(get_the_title()),
153
+			]);
154
+			$results.= ob_get_clean();
155
+		}
156
+		wp_reset_postdata();
157
+		return $results;
158
+	}
159 159
 
160
-    /**
161
-     * @param int $postId
162
-     * @param string $key
163
-     * @param mixed $value
164
-     * @return int|bool
165
-     */
166
-    public function set($postId, $key, $value)
167
-    {
168
-        $key = Str::prefix('_', $key);
169
-        return update_post_meta($postId, $key, $value);
170
-    }
160
+	/**
161
+	 * @param int $postId
162
+	 * @param string $key
163
+	 * @param mixed $value
164
+	 * @return int|bool
165
+	 */
166
+	public function set($postId, $key, $value)
167
+	{
168
+		$key = Str::prefix('_', $key);
169
+		return update_post_meta($postId, $key, $value);
170
+	}
171 171
 
172
-    /**
173
-     * @param int $postId
174
-     * @param string $key
175
-     * @param mixed $value
176
-     * @return int|bool
177
-     */
178
-    public function update($postId, $key, $value)
179
-    {
180
-        return $this->set($postId, $key, $value);
181
-    }
172
+	/**
173
+	 * @param int $postId
174
+	 * @param string $key
175
+	 * @param mixed $value
176
+	 * @return int|bool
177
+	 */
178
+	public function update($postId, $key, $value)
179
+	{
180
+		return $this->set($postId, $key, $value);
181
+	}
182 182
 }
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
      * @param bool $single
19 19
      * @return mixed
20 20
      */
21
-    public function get($postId, $key, $single = true)
21
+    public function get( $postId, $key, $single = true )
22 22
     {
23
-        $key = Str::prefix('_', $key);
24
-        return get_post_meta(intval($postId), $key, $single);
23
+        $key = Str::prefix( '_', $key );
24
+        return get_post_meta( intval( $postId ), $key, $single );
25 25
     }
26 26
 
27 27
     /**
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
      * @param string $assignedTo
30 30
      * @return void|WP_Post
31 31
      */
32
-    public function getAssignedToPost($postId, $assignedTo = '')
32
+    public function getAssignedToPost( $postId, $assignedTo = '' )
33 33
     {
34
-        if (empty($assignedTo)) {
35
-            $assignedTo = $this->get($postId, 'assigned_to');
34
+        if( empty($assignedTo) ) {
35
+            $assignedTo = $this->get( $postId, 'assigned_to' );
36 36
         }
37
-        if (empty($assignedTo)) {
37
+        if( empty($assignedTo) ) {
38 38
             return;
39 39
         }
40
-        $assignedPost = get_post($assignedTo);
41
-        if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) {
40
+        $assignedPost = get_post( $assignedTo );
41
+        if( $assignedPost instanceof WP_Post && $assignedPost->ID != $postId ) {
42 42
             return $assignedPost;
43 43
         }
44 44
     }
@@ -48,25 +48,25 @@  discard block
 block discarded – undo
48 48
      * @param string $metaValue
49 49
      * @return array|int
50 50
      */
51
-    public function getReviewCount($metaKey = '', $metaValue = '')
51
+    public function getReviewCount( $metaKey = '', $metaValue = '' )
52 52
     {
53
-        if (!$metaKey) {
54
-            return (array) wp_count_posts(Application::POST_TYPE);
53
+        if( !$metaKey ) {
54
+            return (array)wp_count_posts( Application::POST_TYPE );
55 55
         }
56
-        $counts = glsr(Cache::class)->getReviewCountsFor($metaKey);
57
-        if (!$metaValue) {
56
+        $counts = glsr( Cache::class )->getReviewCountsFor( $metaKey );
57
+        if( !$metaValue ) {
58 58
             return $counts;
59 59
         }
60
-        return Arr::get($counts, $metaValue, 0);
60
+        return Arr::get( $counts, $metaValue, 0 );
61 61
     }
62 62
 
63 63
     /**
64 64
      * @param string $metaReviewType
65 65
      * @return array
66 66
      */
67
-    public function getReviewIdsByType($metaReviewType)
67
+    public function getReviewIdsByType( $metaReviewType )
68 68
     {
69
-        return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType);
69
+        return glsr( SqlQueries::class )->getReviewIdsByType( $metaReviewType );
70 70
     }
71 71
 
72 72
     /**
@@ -74,24 +74,24 @@  discard block
 block discarded – undo
74 74
      * @param string $status
75 75
      * @return array
76 76
      */
77
-    public function getReviewsMeta($key, $status = 'publish')
77
+    public function getReviewsMeta( $key, $status = 'publish' )
78 78
     {
79
-        if ('all' == $status || empty($status)) {
80
-            $status = get_post_stati(['exclude_from_search' => false]);
79
+        if( 'all' == $status || empty($status) ) {
80
+            $status = get_post_stati( ['exclude_from_search' => false] );
81 81
         }
82
-        return glsr(SqlQueries::class)->getReviewsMeta($key, $status);
82
+        return glsr( SqlQueries::class )->getReviewsMeta( $key, $status );
83 83
     }
84 84
 
85 85
     /**
86 86
      * @param string $field
87 87
      * @return array
88 88
      */
89
-    public function getTermIds(array $values, $field)
89
+    public function getTermIds( array $values, $field )
90 90
     {
91 91
         $termIds = [];
92
-        foreach ($values as $value) {
93
-            $term = get_term_by($field, $value, Application::TAXONOMY);
94
-            if (!isset($term->term_id)) {
92
+        foreach( $values as $value ) {
93
+            $term = get_term_by( $field, $value, Application::TAXONOMY );
94
+            if( !isset($term->term_id) ) {
95 95
                 continue;
96 96
             }
97 97
             $termIds[] = $term->term_id;
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
     /**
103 103
      * @return array
104 104
      */
105
-    public function getTerms(array $args = [])
105
+    public function getTerms( array $args = [] )
106 106
     {
107
-        $args = wp_parse_args($args, [
107
+        $args = wp_parse_args( $args, [
108 108
             'count' => false,
109 109
             'fields' => 'id=>name',
110 110
             'hide_empty' => false,
111 111
             'taxonomy' => Application::TAXONOMY,
112
-        ]);
113
-        $terms = get_terms($args);
114
-        if (is_wp_error($terms)) {
115
-            glsr_log()->error($terms->get_error_message());
112
+        ] );
113
+        $terms = get_terms( $args );
114
+        if( is_wp_error( $terms ) ) {
115
+            glsr_log()->error( $terms->get_error_message() );
116 116
             return [];
117 117
         }
118 118
         return $terms;
@@ -122,36 +122,36 @@  discard block
 block discarded – undo
122 122
      * @param string $searchTerm
123 123
      * @return void|string
124 124
      */
125
-    public function searchPosts($searchTerm)
125
+    public function searchPosts( $searchTerm )
126 126
     {
127 127
         $args = [
128 128
             'post_status' => 'publish',
129 129
             'post_type' => 'any',
130 130
         ];
131
-        if (is_numeric($searchTerm)) {
131
+        if( is_numeric( $searchTerm ) ) {
132 132
             $args['post__in'] = [$searchTerm];
133 133
         } else {
134 134
             $args['orderby'] = 'relevance';
135 135
             $args['posts_per_page'] = 10;
136 136
             $args['s'] = $searchTerm;
137 137
         }
138
-        $queryBuilder = glsr(QueryBuilder::class);
139
-        add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2);
140
-        $search = new WP_Query($args);
141
-        remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500);
142
-        if (!$search->have_posts()) {
138
+        $queryBuilder = glsr( QueryBuilder::class );
139
+        add_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2 );
140
+        $search = new WP_Query( $args );
141
+        remove_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500 );
142
+        if( !$search->have_posts() ) {
143 143
             return;
144 144
         }
145 145
         $results = '';
146
-        while ($search->have_posts()) {
146
+        while( $search->have_posts() ) {
147 147
             $search->the_post();
148 148
             ob_start();
149
-            glsr()->render('partials/editor/search-result', [
149
+            glsr()->render( 'partials/editor/search-result', [
150 150
                 'ID' => get_the_ID(),
151
-                'permalink' => esc_url((string) get_permalink()),
152
-                'title' => esc_attr(get_the_title()),
153
-            ]);
154
-            $results.= ob_get_clean();
151
+                'permalink' => esc_url( (string)get_permalink() ),
152
+                'title' => esc_attr( get_the_title() ),
153
+            ] );
154
+            $results .= ob_get_clean();
155 155
         }
156 156
         wp_reset_postdata();
157 157
         return $results;
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
      * @param mixed $value
164 164
      * @return int|bool
165 165
      */
166
-    public function set($postId, $key, $value)
166
+    public function set( $postId, $key, $value )
167 167
     {
168
-        $key = Str::prefix('_', $key);
169
-        return update_post_meta($postId, $key, $value);
168
+        $key = Str::prefix( '_', $key );
169
+        return update_post_meta( $postId, $key, $value );
170 170
     }
171 171
 
172 172
     /**
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
      * @param mixed $value
176 176
      * @return int|bool
177 177
      */
178
-    public function update($postId, $key, $value)
178
+    public function update( $postId, $key, $value )
179 179
     {
180
-        return $this->set($postId, $key, $value);
180
+        return $this->set( $postId, $key, $value );
181 181
     }
182 182
 }
Please login to merge, or discard this patch.
config/forms/submission-form.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,33 +1,33 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 return [
4
-    'rating' => [
5
-        'label' => __('Your overall rating', 'site-reviews'),
6
-        'type' => 'rating',
7
-    ],
8
-    'title' => [
9
-        'label' => __('Title of your review', 'site-reviews'),
10
-        'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'),
11
-        'type' => 'text',
12
-    ],
13
-    'content' => [
14
-        'label' => __('Your review', 'site-reviews'),
15
-        'placeholder' => __('Tell people your review', 'site-reviews'),
16
-        'rows' => 5,
17
-        'type' => 'textarea',
18
-    ],
19
-    'name' => [
20
-        'label' => __('Your name', 'site-reviews'),
21
-        'placeholder' => __('Tell us your name', 'site-reviews'),
22
-        'type' => 'text',
23
-    ],
24
-    'email' => [
25
-        'label' => __('Your email', 'site-reviews'),
26
-        'placeholder' => __('Tell us your email', 'site-reviews'),
27
-        'type' => 'email',
28
-    ],
29
-    'terms' => [
30
-        'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'),
31
-        'type' => 'checkbox',
32
-    ],
4
+	'rating' => [
5
+		'label' => __('Your overall rating', 'site-reviews'),
6
+		'type' => 'rating',
7
+	],
8
+	'title' => [
9
+		'label' => __('Title of your review', 'site-reviews'),
10
+		'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'),
11
+		'type' => 'text',
12
+	],
13
+	'content' => [
14
+		'label' => __('Your review', 'site-reviews'),
15
+		'placeholder' => __('Tell people your review', 'site-reviews'),
16
+		'rows' => 5,
17
+		'type' => 'textarea',
18
+	],
19
+	'name' => [
20
+		'label' => __('Your name', 'site-reviews'),
21
+		'placeholder' => __('Tell us your name', 'site-reviews'),
22
+		'type' => 'text',
23
+	],
24
+	'email' => [
25
+		'label' => __('Your email', 'site-reviews'),
26
+		'placeholder' => __('Tell us your email', 'site-reviews'),
27
+		'type' => 'email',
28
+	],
29
+	'terms' => [
30
+		'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'),
31
+		'type' => 'checkbox',
32
+	],
33 33
 ];
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,32 +2,32 @@
 block discarded – undo
2 2
 
3 3
 return [
4 4
     'rating' => [
5
-        'label' => __('Your overall rating', 'site-reviews'),
5
+        'label' => __( 'Your overall rating', 'site-reviews' ),
6 6
         'type' => 'rating',
7 7
     ],
8 8
     'title' => [
9
-        'label' => __('Title of your review', 'site-reviews'),
10
-        'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'),
9
+        'label' => __( 'Title of your review', 'site-reviews' ),
10
+        'placeholder' => __( 'Summarize your review or highlight an interesting detail', 'site-reviews' ),
11 11
         'type' => 'text',
12 12
     ],
13 13
     'content' => [
14
-        'label' => __('Your review', 'site-reviews'),
15
-        'placeholder' => __('Tell people your review', 'site-reviews'),
14
+        'label' => __( 'Your review', 'site-reviews' ),
15
+        'placeholder' => __( 'Tell people your review', 'site-reviews' ),
16 16
         'rows' => 5,
17 17
         'type' => 'textarea',
18 18
     ],
19 19
     'name' => [
20
-        'label' => __('Your name', 'site-reviews'),
21
-        'placeholder' => __('Tell us your name', 'site-reviews'),
20
+        'label' => __( 'Your name', 'site-reviews' ),
21
+        'placeholder' => __( 'Tell us your name', 'site-reviews' ),
22 22
         'type' => 'text',
23 23
     ],
24 24
     'email' => [
25
-        'label' => __('Your email', 'site-reviews'),
26
-        'placeholder' => __('Tell us your email', 'site-reviews'),
25
+        'label' => __( 'Your email', 'site-reviews' ),
26
+        'placeholder' => __( 'Tell us your email', 'site-reviews' ),
27 27
         'type' => 'email',
28 28
     ],
29 29
     'terms' => [
30
-        'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'),
30
+        'label' => __( 'This review is based on my own experience and is my genuine opinion.', 'site-reviews' ),
31 31
         'type' => 'checkbox',
32 32
     ],
33 33
 ];
Please login to merge, or discard this patch.