Passed
Push — master ( ff717e...ba0f3b )
by Paul
08:41 queued 04:33
created
plugin/Modules/Schema/Rating.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,19 +12,19 @@
 block discarded – undo
12 12
  */
13 13
 class Rating extends BaseType
14 14
 {
15
-    /**
16
-     * @var array
17
-     * @see http://schema.org/{property_name}
18
-     */
19
-    public $allowed = [
20
-        'author', 'bestRating', 'ratingValue', 'worstRating',
21
-    ];
15
+	/**
16
+	 * @var array
17
+	 * @see http://schema.org/{property_name}
18
+	 */
19
+	public $allowed = [
20
+		'author', 'bestRating', 'ratingValue', 'worstRating',
21
+	];
22 22
 
23
-    /**
24
-     * @var array
25
-     * @see http://schema.org/{property_name}
26
-     */
27
-    public $parents = [
28
-        'Intangible',
29
-    ];
23
+	/**
24
+	 * @var array
25
+	 * @see http://schema.org/{property_name}
26
+	 */
27
+	public $parents = [
28
+		'Intangible',
29
+	];
30 30
 }
Please login to merge, or discard this patch.
plugin/Modules/Validator/ValidationRules.php 1 patch
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -9,126 +9,126 @@
 block discarded – undo
9 9
  */
10 10
 trait ValidationRules
11 11
 {
12
-    /**
13
-     * Get the size of an attribute.
14
-     * @param string $attribute
15
-     * @param mixed $value
16
-     * @return mixed
17
-     */
18
-    abstract protected function getSize($attribute, $value);
12
+	/**
13
+	 * Get the size of an attribute.
14
+	 * @param string $attribute
15
+	 * @param mixed $value
16
+	 * @return mixed
17
+	 */
18
+	abstract protected function getSize($attribute, $value);
19 19
 
20
-    /**
21
-     * Replace all placeholders.
22
-     * @param string $message
23
-     * @return string
24
-     */
25
-    protected function replace($message, array $parameters)
26
-    {
27
-        if (false === strpos($message, '%s')) {
28
-            return $message;
29
-        }
30
-        return preg_replace_callback('/(%s)/', function () use (&$parameters) {
31
-            foreach ($parameters as $key => $value) {
32
-                return array_shift($parameters);
33
-            }
34
-        }, $message);
35
-    }
20
+	/**
21
+	 * Replace all placeholders.
22
+	 * @param string $message
23
+	 * @return string
24
+	 */
25
+	protected function replace($message, array $parameters)
26
+	{
27
+		if (false === strpos($message, '%s')) {
28
+			return $message;
29
+		}
30
+		return preg_replace_callback('/(%s)/', function () use (&$parameters) {
31
+			foreach ($parameters as $key => $value) {
32
+				return array_shift($parameters);
33
+			}
34
+		}, $message);
35
+	}
36 36
 
37
-    /**
38
-     * Validate that an attribute was "accepted".
39
-     * This validation rule implies the attribute is "required".
40
-     * @param string $attribute
41
-     * @param mixed $value
42
-     * @return bool
43
-     */
44
-    public function validateAccepted($value)
45
-    {
46
-        $acceptable = ['yes', 'on', '1', 1, true, 'true'];
47
-        return $this->validateRequired($value) && in_array($value, $acceptable, true);
48
-    }
37
+	/**
38
+	 * Validate that an attribute was "accepted".
39
+	 * This validation rule implies the attribute is "required".
40
+	 * @param string $attribute
41
+	 * @param mixed $value
42
+	 * @return bool
43
+	 */
44
+	public function validateAccepted($value)
45
+	{
46
+		$acceptable = ['yes', 'on', '1', 1, true, 'true'];
47
+		return $this->validateRequired($value) && in_array($value, $acceptable, true);
48
+	}
49 49
 
50
-    /**
51
-     * Validate the size of an attribute is between a set of values.
52
-     * @param string $attribute
53
-     * @param mixed $value
54
-     * @return bool
55
-     */
56
-    public function validateBetween($value, $attribute, array $parameters)
57
-    {
58
-        $this->requireParameterCount(2, $parameters, 'between');
59
-        $size = $this->getSize($attribute, $value);
60
-        return $size >= $parameters[0] && $size <= $parameters[1];
61
-    }
50
+	/**
51
+	 * Validate the size of an attribute is between a set of values.
52
+	 * @param string $attribute
53
+	 * @param mixed $value
54
+	 * @return bool
55
+	 */
56
+	public function validateBetween($value, $attribute, array $parameters)
57
+	{
58
+		$this->requireParameterCount(2, $parameters, 'between');
59
+		$size = $this->getSize($attribute, $value);
60
+		return $size >= $parameters[0] && $size <= $parameters[1];
61
+	}
62 62
 
63
-    /**
64
-     * Validate that an attribute is a valid e-mail address.
65
-     * @param mixed $value
66
-     * @return bool
67
-     */
68
-    public function validateEmail($value)
69
-    {
70
-        return false !== filter_var($value, FILTER_VALIDATE_EMAIL);
71
-    }
63
+	/**
64
+	 * Validate that an attribute is a valid e-mail address.
65
+	 * @param mixed $value
66
+	 * @return bool
67
+	 */
68
+	public function validateEmail($value)
69
+	{
70
+		return false !== filter_var($value, FILTER_VALIDATE_EMAIL);
71
+	}
72 72
 
73
-    /**
74
-     * Validate the size of an attribute is less than a maximum value.
75
-     * @param string $attribute
76
-     * @param mixed $value
77
-     * @return bool
78
-     */
79
-    public function validateMax($value, $attribute, array $parameters)
80
-    {
81
-        $this->requireParameterCount(1, $parameters, 'max');
82
-        return $this->getSize($attribute, $value) <= $parameters[0];
83
-    }
73
+	/**
74
+	 * Validate the size of an attribute is less than a maximum value.
75
+	 * @param string $attribute
76
+	 * @param mixed $value
77
+	 * @return bool
78
+	 */
79
+	public function validateMax($value, $attribute, array $parameters)
80
+	{
81
+		$this->requireParameterCount(1, $parameters, 'max');
82
+		return $this->getSize($attribute, $value) <= $parameters[0];
83
+	}
84 84
 
85
-    /**
86
-     * Validate the size of an attribute is greater than a minimum value.
87
-     * @param string $attribute
88
-     * @param mixed $value
89
-     * @return bool
90
-     */
91
-    public function validateMin($value, $attribute, array $parameters)
92
-    {
93
-        $this->requireParameterCount(1, $parameters, 'min');
94
-        return $this->getSize($attribute, $value) >= $parameters[0];
95
-    }
85
+	/**
86
+	 * Validate the size of an attribute is greater than a minimum value.
87
+	 * @param string $attribute
88
+	 * @param mixed $value
89
+	 * @return bool
90
+	 */
91
+	public function validateMin($value, $attribute, array $parameters)
92
+	{
93
+		$this->requireParameterCount(1, $parameters, 'min');
94
+		return $this->getSize($attribute, $value) >= $parameters[0];
95
+	}
96 96
 
97
-    /**
98
-     * Validate that an attribute is numeric.
99
-     * @param mixed $value
100
-     * @return bool
101
-     */
102
-    public function validateNumber($value)
103
-    {
104
-        return is_numeric($value);
105
-    }
97
+	/**
98
+	 * Validate that an attribute is numeric.
99
+	 * @param mixed $value
100
+	 * @return bool
101
+	 */
102
+	public function validateNumber($value)
103
+	{
104
+		return is_numeric($value);
105
+	}
106 106
 
107
-    /**
108
-     * Validate that a required attribute exists.
109
-     * @param mixed $value
110
-     * @return bool
111
-     */
112
-    public function validateRequired($value)
113
-    {
114
-        return is_null($value)
115
-            || (is_string($value) && '' === trim($value))
116
-            || (is_array($value) && count($value) < 1)
117
-            ? false
118
-            : true;
119
-    }
107
+	/**
108
+	 * Validate that a required attribute exists.
109
+	 * @param mixed $value
110
+	 * @return bool
111
+	 */
112
+	public function validateRequired($value)
113
+	{
114
+		return is_null($value)
115
+			|| (is_string($value) && '' === trim($value))
116
+			|| (is_array($value) && count($value) < 1)
117
+			? false
118
+			: true;
119
+	}
120 120
 
121
-    /**
122
-     * Require a certain number of parameters to be present.
123
-     * @param int $count
124
-     * @param string $rule
125
-     * @return void
126
-     * @throws InvalidArgumentException
127
-     */
128
-    protected function requireParameterCount($count, array $parameters, $rule)
129
-    {
130
-        if (count($parameters) < $count) {
131
-            throw new InvalidArgumentException("Validation rule $rule requires at least $count parameters.");
132
-        }
133
-    }
121
+	/**
122
+	 * Require a certain number of parameters to be present.
123
+	 * @param int $count
124
+	 * @param string $rule
125
+	 * @return void
126
+	 * @throws InvalidArgumentException
127
+	 */
128
+	protected function requireParameterCount($count, array $parameters, $rule)
129
+	{
130
+		if (count($parameters) < $count) {
131
+			throw new InvalidArgumentException("Validation rule $rule requires at least $count parameters.");
132
+		}
133
+	}
134 134
 }
Please login to merge, or discard this patch.
plugin/Contracts/ShortcodeContract.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 
5 5
 interface ShortcodeContract
6 6
 {
7
-    /**
8
-     * @params string|array $atts
9
-     * @return string
10
-     */
11
-    public function buildShortcode($atts = []);
7
+	/**
8
+	 * @params string|array $atts
9
+	 * @return string
10
+	 */
11
+	public function buildShortcode($atts = []);
12 12
 }
Please login to merge, or discard this patch.
plugin/Contracts/HooksContract.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 interface HooksContract
6 6
 {
7
-    /**
8
-     * @return void
9
-     */
10
-    public function run();
7
+	/**
8
+	 * @return void
9
+	 */
10
+	public function run();
11 11
 }
Please login to merge, or discard this patch.
plugin/Contracts/PartialContract.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 interface PartialContract
6 6
 {
7
-    /**
8
-     * @return void|string
9
-     */
10
-    public function build(array $args = []);
7
+	/**
8
+	 * @return void|string
9
+	 */
10
+	public function build(array $args = []);
11 11
 }
Please login to merge, or discard this patch.
plugin/Contracts/ProviderContract.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@
 block discarded – undo
6 6
 
7 7
 interface ProviderContract
8 8
 {
9
-    /**
10
-     * @return void
11
-     */
12
-    public function register(Application $app);
9
+	/**
10
+	 * @return void
11
+	 */
12
+	public function register(Application $app);
13 13
 }
Please login to merge, or discard this patch.
plugin/Database/Cache.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -6,68 +6,68 @@
 block discarded – undo
6 6
 
7 7
 class Cache
8 8
 {
9
-    const EXPIRY_TIME = WEEK_IN_SECONDS;
9
+	const EXPIRY_TIME = WEEK_IN_SECONDS;
10 10
 
11
-    /**
12
-     * @return array
13
-     */
14
-    public function getCloudflareIps()
15
-    {
16
-        $ipAddresses = get_transient(Application::ID.'_cloudflare_ips');
17
-        if (false === $ipAddresses) {
18
-            $ipAddresses = array_fill_keys(['v4', 'v6'], []);
19
-            foreach (array_keys($ipAddresses) as $version) {
20
-                $url = 'https://www.cloudflare.com/ips-'.$version;
21
-                $response = wp_remote_get($url);
22
-                if (is_wp_error($response)) {
23
-                    glsr_log()->error($response->get_error_message());
24
-                    continue;
25
-                }
26
-                if ('200' != ($statusCode = wp_remote_retrieve_response_code($response))) {
27
-                    glsr_log()->error('Unable to connect to '.$url.' ['.$statusCode.']');
28
-                    continue;
29
-                }
30
-                $ipAddresses[$version] = array_filter(
31
-                    (array) preg_split('/\R/', wp_remote_retrieve_body($response))
32
-                );
33
-            }
34
-            set_transient(Application::ID.'_cloudflare_ips', $ipAddresses, static::EXPIRY_TIME);
35
-        }
36
-        return $ipAddresses;
37
-    }
11
+	/**
12
+	 * @return array
13
+	 */
14
+	public function getCloudflareIps()
15
+	{
16
+		$ipAddresses = get_transient(Application::ID.'_cloudflare_ips');
17
+		if (false === $ipAddresses) {
18
+			$ipAddresses = array_fill_keys(['v4', 'v6'], []);
19
+			foreach (array_keys($ipAddresses) as $version) {
20
+				$url = 'https://www.cloudflare.com/ips-'.$version;
21
+				$response = wp_remote_get($url);
22
+				if (is_wp_error($response)) {
23
+					glsr_log()->error($response->get_error_message());
24
+					continue;
25
+				}
26
+				if ('200' != ($statusCode = wp_remote_retrieve_response_code($response))) {
27
+					glsr_log()->error('Unable to connect to '.$url.' ['.$statusCode.']');
28
+					continue;
29
+				}
30
+				$ipAddresses[$version] = array_filter(
31
+					(array) preg_split('/\R/', wp_remote_retrieve_body($response))
32
+				);
33
+			}
34
+			set_transient(Application::ID.'_cloudflare_ips', $ipAddresses, static::EXPIRY_TIME);
35
+		}
36
+		return $ipAddresses;
37
+	}
38 38
 
39
-    /**
40
-     * @param string $metaKey
41
-     * @return array
42
-     */
43
-    public function getReviewCountsFor($metaKey)
44
-    {
45
-        $counts = wp_cache_get(Application::ID, $metaKey.'_count');
46
-        if (false === $counts) {
47
-            $counts = [];
48
-            $results = glsr(SqlQueries::class)->getReviewCountsFor($metaKey);
49
-            foreach ($results as $result) {
50
-                $counts[$result->name] = $result->num_posts;
51
-            }
52
-            wp_cache_set(Application::ID, $counts, $metaKey.'_count');
53
-        }
54
-        return $counts;
55
-    }
39
+	/**
40
+	 * @param string $metaKey
41
+	 * @return array
42
+	 */
43
+	public function getReviewCountsFor($metaKey)
44
+	{
45
+		$counts = wp_cache_get(Application::ID, $metaKey.'_count');
46
+		if (false === $counts) {
47
+			$counts = [];
48
+			$results = glsr(SqlQueries::class)->getReviewCountsFor($metaKey);
49
+			foreach ($results as $result) {
50
+				$counts[$result->name] = $result->num_posts;
51
+			}
52
+			wp_cache_set(Application::ID, $counts, $metaKey.'_count');
53
+		}
54
+		return $counts;
55
+	}
56 56
 
57
-    /**
58
-     * @return string
59
-     */
60
-    public function getRemotePostTest()
61
-    {
62
-        $test = get_transient(Application::ID.'_remote_post_test');
63
-        if (false === $test) {
64
-            $response = wp_remote_post('https://api.wordpress.org/stats/php/1.0/');
65
-            $test = !is_wp_error($response)
66
-                && in_array($response['response']['code'], range(200, 299))
67
-                ? 'Works'
68
-                : 'Does not work';
69
-            set_transient(Application::ID.'_remote_post_test', $test, static::EXPIRY_TIME);
70
-        }
71
-        return $test;
72
-    }
57
+	/**
58
+	 * @return string
59
+	 */
60
+	public function getRemotePostTest()
61
+	{
62
+		$test = get_transient(Application::ID.'_remote_post_test');
63
+		if (false === $test) {
64
+			$response = wp_remote_post('https://api.wordpress.org/stats/php/1.0/');
65
+			$test = !is_wp_error($response)
66
+				&& in_array($response['response']['code'], range(200, 299))
67
+				? 'Works'
68
+				: 'Does not work';
69
+			set_transient(Application::ID.'_remote_post_test', $test, static::EXPIRY_TIME);
70
+		}
71
+		return $test;
72
+	}
73 73
 }
Please login to merge, or discard this patch.
plugin/Blocks/SiteReviewsSummaryBlock.php 1 patch
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -6,83 +6,83 @@
 block discarded – undo
6 6
 
7 7
 class SiteReviewsSummaryBlock extends BlockGenerator
8 8
 {
9
-    /**
10
-     * @return array
11
-     */
12
-    public function attributes()
13
-    {
14
-        return [
15
-            'assigned_to' => [
16
-                'default' => '',
17
-                'type' => 'string',
18
-            ],
19
-            'category' => [
20
-                'default' => '',
21
-                'type' => 'string',
22
-            ],
23
-            'className' => [
24
-                'default' => '',
25
-                'type' => 'string',
26
-            ],
27
-            'hide' => [
28
-                'default' => '',
29
-                'type' => 'string',
30
-            ],
31
-            'post_id' => [
32
-                'default' => '',
33
-                'type' => 'string',
34
-            ],
35
-            'rating' => [
36
-                'default' => '1',
37
-                'type' => 'number',
38
-            ],
39
-            'schema' => [
40
-                'default' => false,
41
-                'type' => 'boolean',
42
-            ],
43
-            'type' => [
44
-                'default' => 'local',
45
-                'type' => 'string',
46
-            ],
47
-        ];
48
-    }
9
+	/**
10
+	 * @return array
11
+	 */
12
+	public function attributes()
13
+	{
14
+		return [
15
+			'assigned_to' => [
16
+				'default' => '',
17
+				'type' => 'string',
18
+			],
19
+			'category' => [
20
+				'default' => '',
21
+				'type' => 'string',
22
+			],
23
+			'className' => [
24
+				'default' => '',
25
+				'type' => 'string',
26
+			],
27
+			'hide' => [
28
+				'default' => '',
29
+				'type' => 'string',
30
+			],
31
+			'post_id' => [
32
+				'default' => '',
33
+				'type' => 'string',
34
+			],
35
+			'rating' => [
36
+				'default' => '1',
37
+				'type' => 'number',
38
+			],
39
+			'schema' => [
40
+				'default' => false,
41
+				'type' => 'boolean',
42
+			],
43
+			'type' => [
44
+				'default' => 'local',
45
+				'type' => 'string',
46
+			],
47
+		];
48
+	}
49 49
 
50
-    /**
51
-     * @return string
52
-     */
53
-    public function render(array $attributes)
54
-    {
55
-        $attributes['class'] = $attributes['className'];
56
-        $shortcode = glsr(Shortcode::class);
57
-        if ('edit' == filter_input(INPUT_GET, 'context')) {
58
-            $attributes = $this->normalize($attributes);
59
-            $this->filterShortcodeClass();
60
-            if (!$this->hasVisibleFields($shortcode, $attributes)) {
61
-                $this->filterInterpolation();
62
-            }
63
-        }
64
-        return $shortcode->buildShortcode($attributes);
65
-    }
50
+	/**
51
+	 * @return string
52
+	 */
53
+	public function render(array $attributes)
54
+	{
55
+		$attributes['class'] = $attributes['className'];
56
+		$shortcode = glsr(Shortcode::class);
57
+		if ('edit' == filter_input(INPUT_GET, 'context')) {
58
+			$attributes = $this->normalize($attributes);
59
+			$this->filterShortcodeClass();
60
+			if (!$this->hasVisibleFields($shortcode, $attributes)) {
61
+				$this->filterInterpolation();
62
+			}
63
+		}
64
+		return $shortcode->buildShortcode($attributes);
65
+	}
66 66
 
67
-    /**
68
-     * @return void
69
-     */
70
-    protected function filterInterpolation()
71
-    {
72
-        add_filter('site-reviews/interpolate/reviews-summary', function ($context) {
73
-            $context['class'] = 'glsr-default glsr-block-disabled';
74
-            $context['text'] = __('You have hidden all of the fields for this block.', 'site-reviews');
75
-            return $context;
76
-        });
77
-    }
67
+	/**
68
+	 * @return void
69
+	 */
70
+	protected function filterInterpolation()
71
+	{
72
+		add_filter('site-reviews/interpolate/reviews-summary', function ($context) {
73
+			$context['class'] = 'glsr-default glsr-block-disabled';
74
+			$context['text'] = __('You have hidden all of the fields for this block.', 'site-reviews');
75
+			return $context;
76
+		});
77
+	}
78 78
 
79
-    /**
80
-     * @return void
81
-     */
82
-    protected function filterShortcodeClass()
83
-    {
84
-        add_filter('site-reviews/style', function () {
85
-            return 'default';
86
-        });
87
-    }
79
+	/**
80
+	 * @return void
81
+	 */
82
+	protected function filterShortcodeClass()
83
+	{
84
+		add_filter('site-reviews/style', function () {
85
+			return 'default';
86
+		});
87
+	}
88 88
 }
Please login to merge, or discard this patch.
plugin/Blocks/SiteReviewsFormBlock.php 1 patch
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -6,115 +6,115 @@
 block discarded – undo
6 6
 
7 7
 class SiteReviewsFormBlock extends BlockGenerator
8 8
 {
9
-    /**
10
-     * @return array
11
-     */
12
-    public function attributes()
13
-    {
14
-        return [
15
-            'assign_to' => [
16
-                'default' => '',
17
-                'type' => 'string',
18
-            ],
19
-            'category' => [
20
-                'default' => '',
21
-                'type' => 'string',
22
-            ],
23
-            'className' => [
24
-                'default' => '',
25
-                'type' => 'string',
26
-            ],
27
-            'hide' => [
28
-                'default' => '',
29
-                'type' => 'string',
30
-            ],
31
-            'id' => [
32
-                'default' => '',
33
-                'type' => 'string',
34
-            ],
35
-        ];
36
-    }
9
+	/**
10
+	 * @return array
11
+	 */
12
+	public function attributes()
13
+	{
14
+		return [
15
+			'assign_to' => [
16
+				'default' => '',
17
+				'type' => 'string',
18
+			],
19
+			'category' => [
20
+				'default' => '',
21
+				'type' => 'string',
22
+			],
23
+			'className' => [
24
+				'default' => '',
25
+				'type' => 'string',
26
+			],
27
+			'hide' => [
28
+				'default' => '',
29
+				'type' => 'string',
30
+			],
31
+			'id' => [
32
+				'default' => '',
33
+				'type' => 'string',
34
+			],
35
+		];
36
+	}
37 37
 
38
-    /**
39
-     * @return string
40
-     */
41
-    public function render(array $attributes)
42
-    {
43
-        $attributes['class'] = $attributes['className'];
44
-        $shortcode = glsr(Shortcode::class);
45
-        if ('edit' == filter_input(INPUT_GET, 'context')) {
46
-            $this->filterFormFields();
47
-            $this->filterRatingField();
48
-            $this->filterShortcodeClass();
49
-            $this->filterSubmitButton();
50
-            if (!$this->hasVisibleFields($shortcode, $attributes)) {
51
-                $this->filterInterpolation();
52
-            }
53
-        }
54
-        return $shortcode->buildShortcode($attributes);
55
-    }
38
+	/**
39
+	 * @return string
40
+	 */
41
+	public function render(array $attributes)
42
+	{
43
+		$attributes['class'] = $attributes['className'];
44
+		$shortcode = glsr(Shortcode::class);
45
+		if ('edit' == filter_input(INPUT_GET, 'context')) {
46
+			$this->filterFormFields();
47
+			$this->filterRatingField();
48
+			$this->filterShortcodeClass();
49
+			$this->filterSubmitButton();
50
+			if (!$this->hasVisibleFields($shortcode, $attributes)) {
51
+				$this->filterInterpolation();
52
+			}
53
+		}
54
+		return $shortcode->buildShortcode($attributes);
55
+	}
56 56
 
57
-    /**
58
-     * @return void
59
-     */
60
-    protected function filterFormFields()
61
-    {
62
-        add_filter('site-reviews/config/forms/submission-form', function (array $config) {
63
-            array_walk($config, function (&$field) {
64
-                $field['disabled'] = true;
65
-                $field['tabindex'] = '-1';
66
-            });
67
-            return $config;
68
-        });
69
-    }
57
+	/**
58
+	 * @return void
59
+	 */
60
+	protected function filterFormFields()
61
+	{
62
+		add_filter('site-reviews/config/forms/submission-form', function (array $config) {
63
+			array_walk($config, function (&$field) {
64
+				$field['disabled'] = true;
65
+				$field['tabindex'] = '-1';
66
+			});
67
+			return $config;
68
+		});
69
+	}
70 70
 
71
-    /**
72
-     * @return void
73
-     */
74
-    protected function filterInterpolation()
75
-    {
76
-        add_filter('site-reviews/interpolate/reviews-form', function ($context) {
77
-            $context['class'] = 'glsr-default glsr-block-disabled';
78
-            $context['fields'] = __('You have hidden all of the fields for this block.', 'site-reviews');
79
-            $context['response'] = '';
80
-            $context['submit_button'] = '';
81
-            return $context;
82
-        });
83
-    }
71
+	/**
72
+	 * @return void
73
+	 */
74
+	protected function filterInterpolation()
75
+	{
76
+		add_filter('site-reviews/interpolate/reviews-form', function ($context) {
77
+			$context['class'] = 'glsr-default glsr-block-disabled';
78
+			$context['fields'] = __('You have hidden all of the fields for this block.', 'site-reviews');
79
+			$context['response'] = '';
80
+			$context['submit_button'] = '';
81
+			return $context;
82
+		});
83
+	}
84 84
 
85
-    /**
86
-     * @return void
87
-     */
88
-    protected function filterRatingField()
89
-    {
90
-        add_filter('site-reviews/rendered/field', function ($html, $type, $args) {
91
-            if ('rating' == $args['path']) {
92
-                $stars = '<span class="glsr-stars">';
93
-                $stars.= str_repeat('<span class="glsr-star glsr-star-empty" aria-hidden="true"></span>', 5);
94
-                $stars.= '</span>';
95
-                $html = preg_replace('/(.*)(<select.*)(<\/select>)(.*)/', '$1'.$stars.'$4', $html);
96
-            }
97
-            return $html;
98
-        }, 10, 3);
99
-    }
85
+	/**
86
+	 * @return void
87
+	 */
88
+	protected function filterRatingField()
89
+	{
90
+		add_filter('site-reviews/rendered/field', function ($html, $type, $args) {
91
+			if ('rating' == $args['path']) {
92
+				$stars = '<span class="glsr-stars">';
93
+				$stars.= str_repeat('<span class="glsr-star glsr-star-empty" aria-hidden="true"></span>', 5);
94
+				$stars.= '</span>';
95
+				$html = preg_replace('/(.*)(<select.*)(<\/select>)(.*)/', '$1'.$stars.'$4', $html);
96
+			}
97
+			return $html;
98
+		}, 10, 3);
99
+	}
100 100
 
101
-    /**
102
-     * @return void
103
-     */
104
-    protected function filterShortcodeClass()
105
-    {
106
-        add_filter('site-reviews/style', function () {
107
-            return 'default';
108
-        });
109
-    }
101
+	/**
102
+	 * @return void
103
+	 */
104
+	protected function filterShortcodeClass()
105
+	{
106
+		add_filter('site-reviews/style', function () {
107
+			return 'default';
108
+		});
109
+	}
110 110
 
111
-    /**
112
-     * @return void
113
-     */
114
-    protected function filterSubmitButton()
115
-    {
116
-        add_filter('site-reviews/rendered/template/form/submit-button', function ($template) {
117
-            return str_replace('type="submit"', 'tabindex="-1"', $template);
118
-        });
119
-    }
111
+	/**
112
+	 * @return void
113
+	 */
114
+	protected function filterSubmitButton()
115
+	{
116
+		add_filter('site-reviews/rendered/template/form/submit-button', function ($template) {
117
+			return str_replace('type="submit"', 'tabindex="-1"', $template);
118
+		});
119
+	}
120 120
 }
Please login to merge, or discard this patch.