Passed
Push — feature/rebusify ( 816514...289185 )
by Paul
07:17
created
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/CreateReview.php 2 patches
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -4,131 +4,131 @@
 block discarded – undo
4 4
 
5 5
 class CreateReview
6 6
 {
7
-    public $ajax_request;
8
-    public $assigned_to;
9
-    public $author;
10
-    public $avatar;
11
-    public $blacklisted;
12
-    public $category;
13
-    public $content;
14
-    public $custom;
15
-    public $date;
16
-    public $email;
17
-    public $form_id;
18
-    public $ip_address;
19
-    public $post_id;
20
-    public $rating;
21
-    public $referer;
22
-    public $request;
23
-    public $response;
24
-    public $terms;
25
-    public $title;
26
-    public $url;
7
+	public $ajax_request;
8
+	public $assigned_to;
9
+	public $author;
10
+	public $avatar;
11
+	public $blacklisted;
12
+	public $category;
13
+	public $content;
14
+	public $custom;
15
+	public $date;
16
+	public $email;
17
+	public $form_id;
18
+	public $ip_address;
19
+	public $post_id;
20
+	public $rating;
21
+	public $referer;
22
+	public $request;
23
+	public $response;
24
+	public $terms;
25
+	public $title;
26
+	public $url;
27 27
 
28
-    public function __construct($input)
29
-    {
30
-        $this->request = $input;
31
-        $this->ajax_request = isset($input['_ajax_request']);
32
-        $this->assigned_to = $this->getNumeric('assign_to');
33
-        $this->author = sanitize_text_field($this->getUser('name'));
34
-        $this->avatar = $this->getAvatar();
35
-        $this->blacklisted = isset($input['blacklisted']);
36
-        $this->category = sanitize_key($this->get('category'));
37
-        $this->content = sanitize_textarea_field($this->get('content'));
38
-        $this->custom = $this->getCustom();
39
-        $this->date = $this->getDate('date');
40
-        $this->email = sanitize_email($this->getUser('email'));
41
-        $this->form_id = sanitize_key($this->get('form_id'));
42
-        $this->ip_address = $this->get('ip_address');
43
-        $this->post_id = intval($this->get('_post_id'));
44
-        $this->rating = intval($this->get('rating'));
45
-        $this->referer = $this->get('_referer');
46
-        $this->response = sanitize_textarea_field($this->get('response'));
47
-        $this->terms = !empty($input['terms']);
48
-        $this->title = sanitize_text_field($this->get('title'));
49
-        $this->url = esc_url_raw($this->get('url'));
50
-    }
28
+	public function __construct($input)
29
+	{
30
+		$this->request = $input;
31
+		$this->ajax_request = isset($input['_ajax_request']);
32
+		$this->assigned_to = $this->getNumeric('assign_to');
33
+		$this->author = sanitize_text_field($this->getUser('name'));
34
+		$this->avatar = $this->getAvatar();
35
+		$this->blacklisted = isset($input['blacklisted']);
36
+		$this->category = sanitize_key($this->get('category'));
37
+		$this->content = sanitize_textarea_field($this->get('content'));
38
+		$this->custom = $this->getCustom();
39
+		$this->date = $this->getDate('date');
40
+		$this->email = sanitize_email($this->getUser('email'));
41
+		$this->form_id = sanitize_key($this->get('form_id'));
42
+		$this->ip_address = $this->get('ip_address');
43
+		$this->post_id = intval($this->get('_post_id'));
44
+		$this->rating = intval($this->get('rating'));
45
+		$this->referer = $this->get('_referer');
46
+		$this->response = sanitize_textarea_field($this->get('response'));
47
+		$this->terms = !empty($input['terms']);
48
+		$this->title = sanitize_text_field($this->get('title'));
49
+		$this->url = esc_url_raw($this->get('url'));
50
+	}
51 51
 
52
-    /**
53
-     * @param string $key
54
-     * @return string
55
-     */
56
-    protected function get($key)
57
-    {
58
-        return (string) glsr_get($this->request, $key);
59
-    }
52
+	/**
53
+	 * @param string $key
54
+	 * @return string
55
+	 */
56
+	protected function get($key)
57
+	{
58
+		return (string) glsr_get($this->request, $key);
59
+	}
60 60
 
61
-    /**
62
-     * @return string
63
-     */
64
-    protected function getAvatar()
65
-    {
66
-        $avatar = $this->get('avatar');
67
-        return !filter_var($avatar, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)
68
-            ? (string) get_avatar_url($this->get('email'))
69
-            : $avatar;
70
-    }
61
+	/**
62
+	 * @return string
63
+	 */
64
+	protected function getAvatar()
65
+	{
66
+		$avatar = $this->get('avatar');
67
+		return !filter_var($avatar, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)
68
+			? (string) get_avatar_url($this->get('email'))
69
+			: $avatar;
70
+	}
71 71
 
72
-    /**
73
-     * @return array
74
-     */
75
-    protected function getCustom()
76
-    {
77
-        $unset = [
78
-            '_action', '_ajax_request', '_counter', '_nonce', '_post_id', '_recaptcha-token',
79
-            '_referer', 'assign_to', 'category', 'content', 'date', 'email', 'excluded', 'form_id',
80
-            'gotcha', 'ip_address', 'name', 'rating', 'response', 'terms', 'title', 'url',
81
-        ];
82
-        $unset = apply_filters('site-reviews/create/unset-keys-from-custom', $unset);
83
-        $custom = $this->request;
84
-        foreach ($unset as $value) {
85
-            unset($custom[$value]);
86
-        }
87
-        return $custom;
88
-    }
72
+	/**
73
+	 * @return array
74
+	 */
75
+	protected function getCustom()
76
+	{
77
+		$unset = [
78
+			'_action', '_ajax_request', '_counter', '_nonce', '_post_id', '_recaptcha-token',
79
+			'_referer', 'assign_to', 'category', 'content', 'date', 'email', 'excluded', 'form_id',
80
+			'gotcha', 'ip_address', 'name', 'rating', 'response', 'terms', 'title', 'url',
81
+		];
82
+		$unset = apply_filters('site-reviews/create/unset-keys-from-custom', $unset);
83
+		$custom = $this->request;
84
+		foreach ($unset as $value) {
85
+			unset($custom[$value]);
86
+		}
87
+		return $custom;
88
+	}
89 89
 
90
-    /**
91
-     * @param string $key
92
-     * @return string
93
-     */
94
-    protected function getDate($key)
95
-    {
96
-        $date = strtotime($this->get($key));
97
-        if (false === $date) {
98
-            $date = time();
99
-        }
100
-        return get_date_from_gmt(gmdate('Y-m-d H:i:s', $date));
101
-    }
90
+	/**
91
+	 * @param string $key
92
+	 * @return string
93
+	 */
94
+	protected function getDate($key)
95
+	{
96
+		$date = strtotime($this->get($key));
97
+		if (false === $date) {
98
+			$date = time();
99
+		}
100
+		return get_date_from_gmt(gmdate('Y-m-d H:i:s', $date));
101
+	}
102 102
 
103
-    /**
104
-     * @param string $key
105
-     * @return string
106
-     */
107
-    protected function getUser($key)
108
-    {
109
-        $value = $this->get($key);
110
-        if (empty($value)) {
111
-            $user = wp_get_current_user();
112
-            $userValues = [
113
-                'email' => 'user_email',
114
-                'name' => 'display_name',
115
-            ];
116
-            if ($user->exists() && array_key_exists($key, $userValues)) {
117
-                return $user->{$userValues[$key]};
118
-            }
119
-        }
120
-        return $value;
121
-    }
103
+	/**
104
+	 * @param string $key
105
+	 * @return string
106
+	 */
107
+	protected function getUser($key)
108
+	{
109
+		$value = $this->get($key);
110
+		if (empty($value)) {
111
+			$user = wp_get_current_user();
112
+			$userValues = [
113
+				'email' => 'user_email',
114
+				'name' => 'display_name',
115
+			];
116
+			if ($user->exists() && array_key_exists($key, $userValues)) {
117
+				return $user->{$userValues[$key]};
118
+			}
119
+		}
120
+		return $value;
121
+	}
122 122
 
123
-    /**
124
-     * @param string $key
125
-     * @return string
126
-     */
127
-    protected function getNumeric($key)
128
-    {
129
-        $value = $this->get($key);
130
-        return is_numeric($value)
131
-            ? $value
132
-            : '';
133
-    }
123
+	/**
124
+	 * @param string $key
125
+	 * @return string
126
+	 */
127
+	protected function getNumeric($key)
128
+	{
129
+		$value = $this->get($key);
130
+		return is_numeric($value)
131
+			? $value
132
+			: '';
133
+	}
134 134
 }
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -25,37 +25,37 @@  discard block
 block discarded – undo
25 25
     public $title;
26 26
     public $url;
27 27
 
28
-    public function __construct($input)
28
+    public function __construct( $input )
29 29
     {
30 30
         $this->request = $input;
31 31
         $this->ajax_request = isset($input['_ajax_request']);
32
-        $this->assigned_to = $this->getNumeric('assign_to');
33
-        $this->author = sanitize_text_field($this->getUser('name'));
32
+        $this->assigned_to = $this->getNumeric( 'assign_to' );
33
+        $this->author = sanitize_text_field( $this->getUser( 'name' ) );
34 34
         $this->avatar = $this->getAvatar();
35 35
         $this->blacklisted = isset($input['blacklisted']);
36
-        $this->category = sanitize_key($this->get('category'));
37
-        $this->content = sanitize_textarea_field($this->get('content'));
36
+        $this->category = sanitize_key( $this->get( 'category' ) );
37
+        $this->content = sanitize_textarea_field( $this->get( 'content' ) );
38 38
         $this->custom = $this->getCustom();
39
-        $this->date = $this->getDate('date');
40
-        $this->email = sanitize_email($this->getUser('email'));
41
-        $this->form_id = sanitize_key($this->get('form_id'));
42
-        $this->ip_address = $this->get('ip_address');
43
-        $this->post_id = intval($this->get('_post_id'));
44
-        $this->rating = intval($this->get('rating'));
45
-        $this->referer = $this->get('_referer');
46
-        $this->response = sanitize_textarea_field($this->get('response'));
39
+        $this->date = $this->getDate( 'date' );
40
+        $this->email = sanitize_email( $this->getUser( 'email' ) );
41
+        $this->form_id = sanitize_key( $this->get( 'form_id' ) );
42
+        $this->ip_address = $this->get( 'ip_address' );
43
+        $this->post_id = intval( $this->get( '_post_id' ) );
44
+        $this->rating = intval( $this->get( 'rating' ) );
45
+        $this->referer = $this->get( '_referer' );
46
+        $this->response = sanitize_textarea_field( $this->get( 'response' ) );
47 47
         $this->terms = !empty($input['terms']);
48
-        $this->title = sanitize_text_field($this->get('title'));
49
-        $this->url = esc_url_raw($this->get('url'));
48
+        $this->title = sanitize_text_field( $this->get( 'title' ) );
49
+        $this->url = esc_url_raw( $this->get( 'url' ) );
50 50
     }
51 51
 
52 52
     /**
53 53
      * @param string $key
54 54
      * @return string
55 55
      */
56
-    protected function get($key)
56
+    protected function get( $key )
57 57
     {
58
-        return (string) glsr_get($this->request, $key);
58
+        return (string)glsr_get( $this->request, $key );
59 59
     }
60 60
 
61 61
     /**
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
      */
64 64
     protected function getAvatar()
65 65
     {
66
-        $avatar = $this->get('avatar');
67
-        return !filter_var($avatar, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)
68
-            ? (string) get_avatar_url($this->get('email'))
66
+        $avatar = $this->get( 'avatar' );
67
+        return !filter_var( $avatar, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED )
68
+            ? (string)get_avatar_url( $this->get( 'email' ) )
69 69
             : $avatar;
70 70
     }
71 71
 
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
             '_referer', 'assign_to', 'category', 'content', 'date', 'email', 'excluded', 'form_id',
80 80
             'gotcha', 'ip_address', 'name', 'rating', 'response', 'terms', 'title', 'url',
81 81
         ];
82
-        $unset = apply_filters('site-reviews/create/unset-keys-from-custom', $unset);
82
+        $unset = apply_filters( 'site-reviews/create/unset-keys-from-custom', $unset );
83 83
         $custom = $this->request;
84
-        foreach ($unset as $value) {
84
+        foreach( $unset as $value ) {
85 85
             unset($custom[$value]);
86 86
         }
87 87
         return $custom;
@@ -91,29 +91,29 @@  discard block
 block discarded – undo
91 91
      * @param string $key
92 92
      * @return string
93 93
      */
94
-    protected function getDate($key)
94
+    protected function getDate( $key )
95 95
     {
96
-        $date = strtotime($this->get($key));
97
-        if (false === $date) {
96
+        $date = strtotime( $this->get( $key ) );
97
+        if( false === $date ) {
98 98
             $date = time();
99 99
         }
100
-        return get_date_from_gmt(gmdate('Y-m-d H:i:s', $date));
100
+        return get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $date ) );
101 101
     }
102 102
 
103 103
     /**
104 104
      * @param string $key
105 105
      * @return string
106 106
      */
107
-    protected function getUser($key)
107
+    protected function getUser( $key )
108 108
     {
109
-        $value = $this->get($key);
110
-        if (empty($value)) {
109
+        $value = $this->get( $key );
110
+        if( empty($value) ) {
111 111
             $user = wp_get_current_user();
112 112
             $userValues = [
113 113
                 'email' => 'user_email',
114 114
                 'name' => 'display_name',
115 115
             ];
116
-            if ($user->exists() && array_key_exists($key, $userValues)) {
116
+            if( $user->exists() && array_key_exists( $key, $userValues ) ) {
117 117
                 return $user->{$userValues[$key]};
118 118
             }
119 119
         }
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
      * @param string $key
125 125
      * @return string
126 126
      */
127
-    protected function getNumeric($key)
127
+    protected function getNumeric( $key )
128 128
     {
129
-        $value = $this->get($key);
130
-        return is_numeric($value)
129
+        $value = $this->get( $key );
130
+        return is_numeric( $value )
131 131
             ? $value
132 132
             : '';
133 133
     }
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/RegisterPostType.php 2 patches
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -9,77 +9,77 @@
 block discarded – undo
9 9
 
10 10
 class RegisterPostType
11 11
 {
12
-    public $args;
13
-    public $columns;
14
-    public $plural;
15
-    public $postType;
16
-    public $single;
12
+	public $args;
13
+	public $columns;
14
+	public $plural;
15
+	public $postType;
16
+	public $single;
17 17
 
18
-    public function __construct($input)
19
-    {
20
-        $args = glsr(PostTypeDefaults::class)->merge($input);
21
-        $this->normalize($args);
22
-        $this->normalizeColumns();
23
-        $this->normalizeLabels();
24
-    }
18
+	public function __construct($input)
19
+	{
20
+		$args = glsr(PostTypeDefaults::class)->merge($input);
21
+		$this->normalize($args);
22
+		$this->normalizeColumns();
23
+		$this->normalizeLabels();
24
+	}
25 25
 
26
-    /**
27
-     * @return void
28
-     */
29
-    protected function normalize(array $args)
30
-    {
31
-        foreach ($args as $key => $value) {
32
-            $property = glsr(Helper::class)->buildPropertyName($key);
33
-            if (!property_exists($this, $property)) {
34
-                continue;
35
-            }
36
-            $this->$property = $value;
37
-            unset($args[$key]);
38
-        }
39
-        $this->args = wp_parse_args($args, [
40
-            'menu_name' => $this->plural,
41
-        ]);
42
-    }
26
+	/**
27
+	 * @return void
28
+	 */
29
+	protected function normalize(array $args)
30
+	{
31
+		foreach ($args as $key => $value) {
32
+			$property = glsr(Helper::class)->buildPropertyName($key);
33
+			if (!property_exists($this, $property)) {
34
+				continue;
35
+			}
36
+			$this->$property = $value;
37
+			unset($args[$key]);
38
+		}
39
+		$this->args = wp_parse_args($args, [
40
+			'menu_name' => $this->plural,
41
+		]);
42
+	}
43 43
 
44
-    /**
45
-     * @return void
46
-     */
47
-    protected function normalizeLabels()
48
-    {
49
-        $this->args['labels'] = wp_parse_args($this->args['labels'], [
50
-            'add_new_item' => sprintf(_x('Add New %s', 'Add New Post', 'site-reviews'), $this->plural),
51
-            'all_items' => sprintf(_x('All %s', 'All Posts', 'site-reviews'), $this->plural),
52
-            'archives' => sprintf(_x('%s Archives', 'Post Archives', 'site-reviews'), $this->single),
53
-            'edit_item' => sprintf(_x('Edit %s', 'Edit Post', 'site-reviews'), $this->single),
54
-            'insert_into_item' => sprintf(_x('Insert into %s', 'Insert into Post', 'site-reviews'), $this->single),
55
-            'menu_name' => $this->args['menu_name'],
56
-            'name' => $this->plural,
57
-            'new_item' => sprintf(_x('New %s', 'New Post', 'site-reviews'), $this->single),
58
-            'not_found' => sprintf(_x('No %s found', 'No Posts found', 'site-reviews'), $this->plural),
59
-            'not_found_in_trash' => sprintf(_x('No %s found in Trash', 'No Posts found in Trash', 'site-reviews'), $this->plural),
60
-            'search_items' => sprintf(_x('Search %s', 'Search Posts', 'site-reviews'), $this->plural),
61
-            'singular_name' => $this->single,
62
-            'uploaded_to_this_item' => sprintf(_x('Uploaded to this %s', 'Uploaded to this Post', 'site-reviews'), $this->single),
63
-            'view_item' => sprintf(_x('View %s', 'View Post', 'site-reviews'), $this->single),
64
-        ]);
65
-        unset($this->args['menu_name']);
66
-    }
44
+	/**
45
+	 * @return void
46
+	 */
47
+	protected function normalizeLabels()
48
+	{
49
+		$this->args['labels'] = wp_parse_args($this->args['labels'], [
50
+			'add_new_item' => sprintf(_x('Add New %s', 'Add New Post', 'site-reviews'), $this->plural),
51
+			'all_items' => sprintf(_x('All %s', 'All Posts', 'site-reviews'), $this->plural),
52
+			'archives' => sprintf(_x('%s Archives', 'Post Archives', 'site-reviews'), $this->single),
53
+			'edit_item' => sprintf(_x('Edit %s', 'Edit Post', 'site-reviews'), $this->single),
54
+			'insert_into_item' => sprintf(_x('Insert into %s', 'Insert into Post', 'site-reviews'), $this->single),
55
+			'menu_name' => $this->args['menu_name'],
56
+			'name' => $this->plural,
57
+			'new_item' => sprintf(_x('New %s', 'New Post', 'site-reviews'), $this->single),
58
+			'not_found' => sprintf(_x('No %s found', 'No Posts found', 'site-reviews'), $this->plural),
59
+			'not_found_in_trash' => sprintf(_x('No %s found in Trash', 'No Posts found in Trash', 'site-reviews'), $this->plural),
60
+			'search_items' => sprintf(_x('Search %s', 'Search Posts', 'site-reviews'), $this->plural),
61
+			'singular_name' => $this->single,
62
+			'uploaded_to_this_item' => sprintf(_x('Uploaded to this %s', 'Uploaded to this Post', 'site-reviews'), $this->single),
63
+			'view_item' => sprintf(_x('View %s', 'View Post', 'site-reviews'), $this->single),
64
+		]);
65
+		unset($this->args['menu_name']);
66
+	}
67 67
 
68
-    /**
69
-     * @return void
70
-     */
71
-    protected function normalizeColumns()
72
-    {
73
-        $this->columns = ['cb' => ''] + $this->columns;
74
-        if (array_key_exists('category', $this->columns)) {
75
-            $keys = array_keys($this->columns);
76
-            $keys[array_search('category', $keys)] = 'taxonomy-'.Application::TAXONOMY;
77
-            $this->columns = array_combine($keys, $this->columns);
78
-        }
79
-        if (array_key_exists('pinned', $this->columns)) {
80
-            $this->columns['pinned'] = glsr(Builder::class)->span('<span>'.$this->columns['pinned'].'</span>',
81
-                ['class' => 'pinned-icon']
82
-            );
83
-        }
84
-    }
68
+	/**
69
+	 * @return void
70
+	 */
71
+	protected function normalizeColumns()
72
+	{
73
+		$this->columns = ['cb' => ''] + $this->columns;
74
+		if (array_key_exists('category', $this->columns)) {
75
+			$keys = array_keys($this->columns);
76
+			$keys[array_search('category', $keys)] = 'taxonomy-'.Application::TAXONOMY;
77
+			$this->columns = array_combine($keys, $this->columns);
78
+		}
79
+		if (array_key_exists('pinned', $this->columns)) {
80
+			$this->columns['pinned'] = glsr(Builder::class)->span('<span>'.$this->columns['pinned'].'</span>',
81
+				['class' => 'pinned-icon']
82
+			);
83
+		}
84
+	}
85 85
 }
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
     public $postType;
16 16
     public $single;
17 17
 
18
-    public function __construct($input)
18
+    public function __construct( $input )
19 19
     {
20
-        $args = glsr(PostTypeDefaults::class)->merge($input);
21
-        $this->normalize($args);
20
+        $args = glsr( PostTypeDefaults::class )->merge( $input );
21
+        $this->normalize( $args );
22 22
         $this->normalizeColumns();
23 23
         $this->normalizeLabels();
24 24
     }
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
     /**
27 27
      * @return void
28 28
      */
29
-    protected function normalize(array $args)
29
+    protected function normalize( array $args )
30 30
     {
31
-        foreach ($args as $key => $value) {
32
-            $property = glsr(Helper::class)->buildPropertyName($key);
33
-            if (!property_exists($this, $property)) {
31
+        foreach( $args as $key => $value ) {
32
+            $property = glsr( Helper::class )->buildPropertyName( $key );
33
+            if( !property_exists( $this, $property ) ) {
34 34
                 continue;
35 35
             }
36 36
             $this->$property = $value;
37 37
             unset($args[$key]);
38 38
         }
39
-        $this->args = wp_parse_args($args, [
39
+        $this->args = wp_parse_args( $args, [
40 40
             'menu_name' => $this->plural,
41
-        ]);
41
+        ] );
42 42
     }
43 43
 
44 44
     /**
@@ -46,22 +46,22 @@  discard block
 block discarded – undo
46 46
      */
47 47
     protected function normalizeLabels()
48 48
     {
49
-        $this->args['labels'] = wp_parse_args($this->args['labels'], [
50
-            'add_new_item' => sprintf(_x('Add New %s', 'Add New Post', 'site-reviews'), $this->plural),
51
-            'all_items' => sprintf(_x('All %s', 'All Posts', 'site-reviews'), $this->plural),
52
-            'archives' => sprintf(_x('%s Archives', 'Post Archives', 'site-reviews'), $this->single),
53
-            'edit_item' => sprintf(_x('Edit %s', 'Edit Post', 'site-reviews'), $this->single),
54
-            'insert_into_item' => sprintf(_x('Insert into %s', 'Insert into Post', 'site-reviews'), $this->single),
49
+        $this->args['labels'] = wp_parse_args( $this->args['labels'], [
50
+            'add_new_item' => sprintf( _x( 'Add New %s', 'Add New Post', 'site-reviews' ), $this->plural ),
51
+            'all_items' => sprintf( _x( 'All %s', 'All Posts', 'site-reviews' ), $this->plural ),
52
+            'archives' => sprintf( _x( '%s Archives', 'Post Archives', 'site-reviews' ), $this->single ),
53
+            'edit_item' => sprintf( _x( 'Edit %s', 'Edit Post', 'site-reviews' ), $this->single ),
54
+            'insert_into_item' => sprintf( _x( 'Insert into %s', 'Insert into Post', 'site-reviews' ), $this->single ),
55 55
             'menu_name' => $this->args['menu_name'],
56 56
             'name' => $this->plural,
57
-            'new_item' => sprintf(_x('New %s', 'New Post', 'site-reviews'), $this->single),
58
-            'not_found' => sprintf(_x('No %s found', 'No Posts found', 'site-reviews'), $this->plural),
59
-            'not_found_in_trash' => sprintf(_x('No %s found in Trash', 'No Posts found in Trash', 'site-reviews'), $this->plural),
60
-            'search_items' => sprintf(_x('Search %s', 'Search Posts', 'site-reviews'), $this->plural),
57
+            'new_item' => sprintf( _x( 'New %s', 'New Post', 'site-reviews' ), $this->single ),
58
+            'not_found' => sprintf( _x( 'No %s found', 'No Posts found', 'site-reviews' ), $this->plural ),
59
+            'not_found_in_trash' => sprintf( _x( 'No %s found in Trash', 'No Posts found in Trash', 'site-reviews' ), $this->plural ),
60
+            'search_items' => sprintf( _x( 'Search %s', 'Search Posts', 'site-reviews' ), $this->plural ),
61 61
             'singular_name' => $this->single,
62
-            'uploaded_to_this_item' => sprintf(_x('Uploaded to this %s', 'Uploaded to this Post', 'site-reviews'), $this->single),
63
-            'view_item' => sprintf(_x('View %s', 'View Post', 'site-reviews'), $this->single),
64
-        ]);
62
+            'uploaded_to_this_item' => sprintf( _x( 'Uploaded to this %s', 'Uploaded to this Post', 'site-reviews' ), $this->single ),
63
+            'view_item' => sprintf( _x( 'View %s', 'View Post', 'site-reviews' ), $this->single ),
64
+        ] );
65 65
         unset($this->args['menu_name']);
66 66
     }
67 67
 
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
     protected function normalizeColumns()
72 72
     {
73 73
         $this->columns = ['cb' => ''] + $this->columns;
74
-        if (array_key_exists('category', $this->columns)) {
75
-            $keys = array_keys($this->columns);
76
-            $keys[array_search('category', $keys)] = 'taxonomy-'.Application::TAXONOMY;
77
-            $this->columns = array_combine($keys, $this->columns);
74
+        if( array_key_exists( 'category', $this->columns ) ) {
75
+            $keys = array_keys( $this->columns );
76
+            $keys[array_search( 'category', $keys )] = 'taxonomy-'.Application::TAXONOMY;
77
+            $this->columns = array_combine( $keys, $this->columns );
78 78
         }
79
-        if (array_key_exists('pinned', $this->columns)) {
80
-            $this->columns['pinned'] = glsr(Builder::class)->span('<span>'.$this->columns['pinned'].'</span>',
79
+        if( array_key_exists( 'pinned', $this->columns ) ) {
80
+            $this->columns['pinned'] = glsr( Builder::class )->span( '<span>'.$this->columns['pinned'].'</span>',
81 81
                 ['class' => 'pinned-icon']
82 82
             );
83 83
         }
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   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -11,160 +11,160 @@
 block discarded – undo
11 11
 
12 12
 class Database
13 13
 {
14
-    /**
15
-     * @param int $postId
16
-     * @param string $key
17
-     * @param bool $single
18
-     * @return mixed
19
-     */
20
-    public function get($postId, $key, $single = true)
21
-    {
22
-        $key = glsr(Helper::class)->prefixString($key, '_');
23
-        return get_post_meta(intval($postId), $key, $single);
24
-    }
14
+	/**
15
+	 * @param int $postId
16
+	 * @param string $key
17
+	 * @param bool $single
18
+	 * @return mixed
19
+	 */
20
+	public function get($postId, $key, $single = true)
21
+	{
22
+		$key = glsr(Helper::class)->prefixString($key, '_');
23
+		return get_post_meta(intval($postId), $key, $single);
24
+	}
25 25
 
26
-    /**
27
-     * @param int $postId
28
-     * @param string $assignedTo
29
-     * @return void|WP_Post
30
-     */
31
-    public function getAssignedToPost($postId, $assignedTo = '')
32
-    {
33
-        if (empty($assignedTo)) {
34
-            $assignedTo = $this->get($postId, 'assigned_to');
35
-        }
36
-        if (empty($assignedTo)) {
37
-            return;
38
-        }
39
-        $assignedPost = get_post($assignedTo);
40
-        if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) {
41
-            return $assignedPost;
42
-        }
43
-    }
26
+	/**
27
+	 * @param int $postId
28
+	 * @param string $assignedTo
29
+	 * @return void|WP_Post
30
+	 */
31
+	public function getAssignedToPost($postId, $assignedTo = '')
32
+	{
33
+		if (empty($assignedTo)) {
34
+			$assignedTo = $this->get($postId, 'assigned_to');
35
+		}
36
+		if (empty($assignedTo)) {
37
+			return;
38
+		}
39
+		$assignedPost = get_post($assignedTo);
40
+		if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) {
41
+			return $assignedPost;
42
+		}
43
+	}
44 44
 
45
-    /**
46
-     * @param string $metaKey
47
-     * @param string $metaValue
48
-     * @return array|int
49
-     */
50
-    public function getReviewCount($metaKey = '', $metaValue = '')
51
-    {
52
-        if (!$metaKey) {
53
-            return (array) wp_count_posts(Application::POST_TYPE);
54
-        }
55
-        $counts = glsr(Cache::class)->getReviewCountsFor($metaKey);
56
-        if (!$metaValue) {
57
-            return $counts;
58
-        }
59
-        return glsr_get($counts, $metaValue, 0);
60
-    }
45
+	/**
46
+	 * @param string $metaKey
47
+	 * @param string $metaValue
48
+	 * @return array|int
49
+	 */
50
+	public function getReviewCount($metaKey = '', $metaValue = '')
51
+	{
52
+		if (!$metaKey) {
53
+			return (array) wp_count_posts(Application::POST_TYPE);
54
+		}
55
+		$counts = glsr(Cache::class)->getReviewCountsFor($metaKey);
56
+		if (!$metaValue) {
57
+			return $counts;
58
+		}
59
+		return glsr_get($counts, $metaValue, 0);
60
+	}
61 61
 
62
-    /**
63
-     * @param string $metaReviewType
64
-     * @return array
65
-     */
66
-    public function getReviewIdsByType($metaReviewType)
67
-    {
68
-        return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType);
69
-    }
62
+	/**
63
+	 * @param string $metaReviewType
64
+	 * @return array
65
+	 */
66
+	public function getReviewIdsByType($metaReviewType)
67
+	{
68
+		return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType);
69
+	}
70 70
 
71
-    /**
72
-     * @param string $key
73
-     * @param string $status
74
-     * @return array
75
-     */
76
-    public function getReviewsMeta($key, $status = 'publish')
77
-    {
78
-        if ('all' == $status || empty($status)) {
79
-            $status = get_post_stati(['exclude_from_search' => false]);
80
-        }
81
-        return glsr(SqlQueries::class)->getReviewsMeta($key, $status);
82
-    }
71
+	/**
72
+	 * @param string $key
73
+	 * @param string $status
74
+	 * @return array
75
+	 */
76
+	public function getReviewsMeta($key, $status = 'publish')
77
+	{
78
+		if ('all' == $status || empty($status)) {
79
+			$status = get_post_stati(['exclude_from_search' => false]);
80
+		}
81
+		return glsr(SqlQueries::class)->getReviewsMeta($key, $status);
82
+	}
83 83
 
84
-    /**
85
-     * @param string $field
86
-     * @return array
87
-     */
88
-    public function getTermIds(array $values, $field)
89
-    {
90
-        $termIds = [];
91
-        foreach ($values as $value) {
92
-            $term = get_term_by($field, $value, Application::TAXONOMY);
93
-            if (!isset($term->term_id)) {
94
-                continue;
95
-            }
96
-            $termIds[] = $term->term_id;
97
-        }
98
-        return $termIds;
99
-    }
84
+	/**
85
+	 * @param string $field
86
+	 * @return array
87
+	 */
88
+	public function getTermIds(array $values, $field)
89
+	{
90
+		$termIds = [];
91
+		foreach ($values as $value) {
92
+			$term = get_term_by($field, $value, Application::TAXONOMY);
93
+			if (!isset($term->term_id)) {
94
+				continue;
95
+			}
96
+			$termIds[] = $term->term_id;
97
+		}
98
+		return $termIds;
99
+	}
100 100
 
101
-    /**
102
-     * @return array
103
-     */
104
-    public function getTerms(array $args = [])
105
-    {
106
-        $args = wp_parse_args($args, [
107
-            'count' => false,
108
-            'fields' => 'id=>name',
109
-            'hide_empty' => false,
110
-            'taxonomy' => Application::TAXONOMY,
111
-        ]);
112
-        $terms = get_terms($args);
113
-        if (is_wp_error($terms)) {
114
-            glsr_log()->error($terms->get_error_message());
115
-            return [];
116
-        }
117
-        return $terms;
118
-    }
101
+	/**
102
+	 * @return array
103
+	 */
104
+	public function getTerms(array $args = [])
105
+	{
106
+		$args = wp_parse_args($args, [
107
+			'count' => false,
108
+			'fields' => 'id=>name',
109
+			'hide_empty' => false,
110
+			'taxonomy' => Application::TAXONOMY,
111
+		]);
112
+		$terms = get_terms($args);
113
+		if (is_wp_error($terms)) {
114
+			glsr_log()->error($terms->get_error_message());
115
+			return [];
116
+		}
117
+		return $terms;
118
+	}
119 119
 
120
-    /**
121
-     * @param string $searchTerm
122
-     * @return void|string
123
-     */
124
-    public function searchPosts($searchTerm)
125
-    {
126
-        $args = [
127
-            'post_status' => 'publish',
128
-            'post_type' => 'any',
129
-        ];
130
-        if (is_numeric($searchTerm)) {
131
-            $args['post__in'] = [$searchTerm];
132
-        } else {
133
-            $args['orderby'] = 'relevance';
134
-            $args['posts_per_page'] = 10;
135
-            $args['s'] = $searchTerm;
136
-        }
137
-        $queryBuilder = glsr(QueryBuilder::class);
138
-        add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2);
139
-        $search = new WP_Query($args);
140
-        remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500);
141
-        if (!$search->have_posts()) {
142
-            return;
143
-        }
144
-        $results = '';
145
-        while ($search->have_posts()) {
146
-            $search->the_post();
147
-            ob_start();
148
-            glsr()->render('partials/editor/search-result', [
149
-                'ID' => get_the_ID(),
150
-                'permalink' => esc_url((string) get_permalink()),
151
-                'title' => esc_attr(get_the_title()),
152
-            ]);
153
-            $results.= ob_get_clean();
154
-        }
155
-        wp_reset_postdata();
156
-        return $results;
157
-    }
120
+	/**
121
+	 * @param string $searchTerm
122
+	 * @return void|string
123
+	 */
124
+	public function searchPosts($searchTerm)
125
+	{
126
+		$args = [
127
+			'post_status' => 'publish',
128
+			'post_type' => 'any',
129
+		];
130
+		if (is_numeric($searchTerm)) {
131
+			$args['post__in'] = [$searchTerm];
132
+		} else {
133
+			$args['orderby'] = 'relevance';
134
+			$args['posts_per_page'] = 10;
135
+			$args['s'] = $searchTerm;
136
+		}
137
+		$queryBuilder = glsr(QueryBuilder::class);
138
+		add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2);
139
+		$search = new WP_Query($args);
140
+		remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500);
141
+		if (!$search->have_posts()) {
142
+			return;
143
+		}
144
+		$results = '';
145
+		while ($search->have_posts()) {
146
+			$search->the_post();
147
+			ob_start();
148
+			glsr()->render('partials/editor/search-result', [
149
+				'ID' => get_the_ID(),
150
+				'permalink' => esc_url((string) get_permalink()),
151
+				'title' => esc_attr(get_the_title()),
152
+			]);
153
+			$results.= ob_get_clean();
154
+		}
155
+		wp_reset_postdata();
156
+		return $results;
157
+	}
158 158
 
159
-    /**
160
-     * @param int $postId
161
-     * @param string $key
162
-     * @param mixed $value
163
-     * @return int|bool
164
-     */
165
-    public function update($postId, $key, $value)
166
-    {
167
-        $key = glsr(Helper::class)->prefixString($key, '_');
168
-        return update_post_meta($postId, $key, $value);
169
-    }
159
+	/**
160
+	 * @param int $postId
161
+	 * @param string $key
162
+	 * @param mixed $value
163
+	 * @return int|bool
164
+	 */
165
+	public function update($postId, $key, $value)
166
+	{
167
+		$key = glsr(Helper::class)->prefixString($key, '_');
168
+		return update_post_meta($postId, $key, $value);
169
+	}
170 170
 }
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
      * @param bool $single
18 18
      * @return mixed
19 19
      */
20
-    public function get($postId, $key, $single = true)
20
+    public function get( $postId, $key, $single = true )
21 21
     {
22
-        $key = glsr(Helper::class)->prefixString($key, '_');
23
-        return get_post_meta(intval($postId), $key, $single);
22
+        $key = glsr( Helper::class )->prefixString( $key, '_' );
23
+        return get_post_meta( intval( $postId ), $key, $single );
24 24
     }
25 25
 
26 26
     /**
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
      * @param string $assignedTo
29 29
      * @return void|WP_Post
30 30
      */
31
-    public function getAssignedToPost($postId, $assignedTo = '')
31
+    public function getAssignedToPost( $postId, $assignedTo = '' )
32 32
     {
33
-        if (empty($assignedTo)) {
34
-            $assignedTo = $this->get($postId, 'assigned_to');
33
+        if( empty($assignedTo) ) {
34
+            $assignedTo = $this->get( $postId, 'assigned_to' );
35 35
         }
36
-        if (empty($assignedTo)) {
36
+        if( empty($assignedTo) ) {
37 37
             return;
38 38
         }
39
-        $assignedPost = get_post($assignedTo);
40
-        if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) {
39
+        $assignedPost = get_post( $assignedTo );
40
+        if( $assignedPost instanceof WP_Post && $assignedPost->ID != $postId ) {
41 41
             return $assignedPost;
42 42
         }
43 43
     }
@@ -47,25 +47,25 @@  discard block
 block discarded – undo
47 47
      * @param string $metaValue
48 48
      * @return array|int
49 49
      */
50
-    public function getReviewCount($metaKey = '', $metaValue = '')
50
+    public function getReviewCount( $metaKey = '', $metaValue = '' )
51 51
     {
52
-        if (!$metaKey) {
53
-            return (array) wp_count_posts(Application::POST_TYPE);
52
+        if( !$metaKey ) {
53
+            return (array)wp_count_posts( Application::POST_TYPE );
54 54
         }
55
-        $counts = glsr(Cache::class)->getReviewCountsFor($metaKey);
56
-        if (!$metaValue) {
55
+        $counts = glsr( Cache::class )->getReviewCountsFor( $metaKey );
56
+        if( !$metaValue ) {
57 57
             return $counts;
58 58
         }
59
-        return glsr_get($counts, $metaValue, 0);
59
+        return glsr_get( $counts, $metaValue, 0 );
60 60
     }
61 61
 
62 62
     /**
63 63
      * @param string $metaReviewType
64 64
      * @return array
65 65
      */
66
-    public function getReviewIdsByType($metaReviewType)
66
+    public function getReviewIdsByType( $metaReviewType )
67 67
     {
68
-        return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType);
68
+        return glsr( SqlQueries::class )->getReviewIdsByType( $metaReviewType );
69 69
     }
70 70
 
71 71
     /**
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
      * @param string $status
74 74
      * @return array
75 75
      */
76
-    public function getReviewsMeta($key, $status = 'publish')
76
+    public function getReviewsMeta( $key, $status = 'publish' )
77 77
     {
78
-        if ('all' == $status || empty($status)) {
79
-            $status = get_post_stati(['exclude_from_search' => false]);
78
+        if( 'all' == $status || empty($status) ) {
79
+            $status = get_post_stati( ['exclude_from_search' => false] );
80 80
         }
81
-        return glsr(SqlQueries::class)->getReviewsMeta($key, $status);
81
+        return glsr( SqlQueries::class )->getReviewsMeta( $key, $status );
82 82
     }
83 83
 
84 84
     /**
85 85
      * @param string $field
86 86
      * @return array
87 87
      */
88
-    public function getTermIds(array $values, $field)
88
+    public function getTermIds( array $values, $field )
89 89
     {
90 90
         $termIds = [];
91
-        foreach ($values as $value) {
92
-            $term = get_term_by($field, $value, Application::TAXONOMY);
93
-            if (!isset($term->term_id)) {
91
+        foreach( $values as $value ) {
92
+            $term = get_term_by( $field, $value, Application::TAXONOMY );
93
+            if( !isset($term->term_id) ) {
94 94
                 continue;
95 95
             }
96 96
             $termIds[] = $term->term_id;
@@ -101,17 +101,17 @@  discard block
 block discarded – undo
101 101
     /**
102 102
      * @return array
103 103
      */
104
-    public function getTerms(array $args = [])
104
+    public function getTerms( array $args = [] )
105 105
     {
106
-        $args = wp_parse_args($args, [
106
+        $args = wp_parse_args( $args, [
107 107
             'count' => false,
108 108
             'fields' => 'id=>name',
109 109
             'hide_empty' => false,
110 110
             'taxonomy' => Application::TAXONOMY,
111
-        ]);
112
-        $terms = get_terms($args);
113
-        if (is_wp_error($terms)) {
114
-            glsr_log()->error($terms->get_error_message());
111
+        ] );
112
+        $terms = get_terms( $args );
113
+        if( is_wp_error( $terms ) ) {
114
+            glsr_log()->error( $terms->get_error_message() );
115 115
             return [];
116 116
         }
117 117
         return $terms;
@@ -121,36 +121,36 @@  discard block
 block discarded – undo
121 121
      * @param string $searchTerm
122 122
      * @return void|string
123 123
      */
124
-    public function searchPosts($searchTerm)
124
+    public function searchPosts( $searchTerm )
125 125
     {
126 126
         $args = [
127 127
             'post_status' => 'publish',
128 128
             'post_type' => 'any',
129 129
         ];
130
-        if (is_numeric($searchTerm)) {
130
+        if( is_numeric( $searchTerm ) ) {
131 131
             $args['post__in'] = [$searchTerm];
132 132
         } else {
133 133
             $args['orderby'] = 'relevance';
134 134
             $args['posts_per_page'] = 10;
135 135
             $args['s'] = $searchTerm;
136 136
         }
137
-        $queryBuilder = glsr(QueryBuilder::class);
138
-        add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2);
139
-        $search = new WP_Query($args);
140
-        remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500);
141
-        if (!$search->have_posts()) {
137
+        $queryBuilder = glsr( QueryBuilder::class );
138
+        add_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2 );
139
+        $search = new WP_Query( $args );
140
+        remove_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500 );
141
+        if( !$search->have_posts() ) {
142 142
             return;
143 143
         }
144 144
         $results = '';
145
-        while ($search->have_posts()) {
145
+        while( $search->have_posts() ) {
146 146
             $search->the_post();
147 147
             ob_start();
148
-            glsr()->render('partials/editor/search-result', [
148
+            glsr()->render( 'partials/editor/search-result', [
149 149
                 'ID' => get_the_ID(),
150
-                'permalink' => esc_url((string) get_permalink()),
151
-                'title' => esc_attr(get_the_title()),
152
-            ]);
153
-            $results.= ob_get_clean();
150
+                'permalink' => esc_url( (string)get_permalink() ),
151
+                'title' => esc_attr( get_the_title() ),
152
+            ] );
153
+            $results .= ob_get_clean();
154 154
         }
155 155
         wp_reset_postdata();
156 156
         return $results;
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
      * @param mixed $value
163 163
      * @return int|bool
164 164
      */
165
-    public function update($postId, $key, $value)
165
+    public function update( $postId, $key, $value )
166 166
     {
167
-        $key = glsr(Helper::class)->prefixString($key, '_');
168
-        return update_post_meta($postId, $key, $value);
167
+        $key = glsr( Helper::class )->prefixString( $key, '_' );
168
+        return update_post_meta( $postId, $key, $value );
169 169
     }
170 170
 }
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.
config/styles/ninja_forms.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 return [
4
-    'fields' => [
5
-        'input' => 'ninja-forms-field nf-element',
6
-        'textarea' => 'ninja-forms-field nf-element',
7
-    ],
4
+	'fields' => [
5
+		'input' => 'ninja-forms-field nf-element',
6
+		'textarea' => 'ninja-forms-field nf-element',
7
+	],
8 8
 ];
Please login to merge, or discard this patch.