Passed
Push — master ( 6b8ca8...3384db )
by Paul
04:57
created
plugin/Controllers/MenuController.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
 	{
21 21
 		global $menu, $typenow;
22 22
 		foreach( $menu as $key => $value ) {
23
-			if( !isset( $value[2] ) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE )continue;
23
+			if( !isset( $value[2] ) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE ) {
24
+				continue;
25
+			}
24 26
 			$postCount = wp_count_posts( Application::POST_TYPE );
25 27
 			$pendingCount = glsr( Builder::class )->span( number_format_i18n( $postCount->pending ), [
26 28
 				'class' => 'pending-count',
@@ -52,7 +54,9 @@  discard block
 block discarded – undo
52 54
 		foreach( $pages as $slug => $title ) {
53 55
 			$method = glsr( Helper::class )->buildMethodName( 'render-'.$slug.'-menu' );
54 56
 			$callback = apply_filters( 'site-reviews/addon/submenu/callback', [$this, $method], $slug );
55
-			if( !is_callable( $callback ))continue;
57
+			if( !is_callable( $callback )) {
58
+				continue;
59
+			}
56 60
 			add_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, $title, $title, Application::CAPABILITY, $slug, $callback );
57 61
 		}
58 62
 	}
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@  discard block
 block discarded – undo
20 20
 	{
21 21
 		global $menu, $typenow;
22 22
 		foreach( $menu as $key => $value ) {
23
-			if( !isset( $value[2] ) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE )continue;
23
+			if( !isset($value[2]) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE )continue;
24 24
 			$postCount = wp_count_posts( Application::POST_TYPE );
25 25
 			$pendingCount = glsr( Builder::class )->span( number_format_i18n( $postCount->pending ), [
26 26
 				'class' => 'pending-count',
27
-			]);
27
+			] );
28 28
 			$awaitingModeration = glsr( Builder::class )->span( $pendingCount, [
29 29
 				'class' => 'awaiting-mod count-'.$postCount->pending,
30
-			]);
30
+			] );
31 31
 			$menu[$key][0] .= $awaitingModeration;
32 32
 			if( $typenow === Application::POST_TYPE ) {
33 33
 				$menu[$key][4] .= ' current';
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 			'tools' => __( 'Tools', 'site-reviews' ),
49 49
 			'documentation' => __( 'Documentation', 'site-reviews' ),
50 50
 			'addons' => __( 'Add-Ons', 'site-reviews' ),
51
-		]);
51
+		] );
52 52
 		foreach( $pages as $slug => $title ) {
53 53
 			$method = glsr( Helper::class )->buildMethodName( 'render-'.$slug.'-menu' );
54 54
 			$callback = apply_filters( 'site-reviews/addon/submenu/callback', [$this, $method], $slug );
55
-			if( !is_callable( $callback ))continue;
55
+			if( !is_callable( $callback ) )continue;
56 56
 			add_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, $title, $title, Application::CAPABILITY, $slug, $callback );
57 57
 		}
58 58
 	}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 			'shortcodes' => __( 'Shortcodes', 'site-reviews' ),
85 85
 			'hooks' => __( 'Hooks', 'site-reviews' ),
86 86
 			'functions' => __( 'Functions', 'site-reviews' ),
87
-		]);
87
+		] );
88 88
 		$this->renderMenu( 'documentation', $tabs );
89 89
 	}
90 90
 
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
 			'schema' => __( 'Schema', 'site-reviews' ),
104 104
 			'translations' => __( 'Translations', 'site-reviews' ),
105 105
 			'licenses' => __( 'Licenses', 'site-reviews' ),
106
-		]);
106
+		] );
107 107
 		$this->renderMenu( 'settings', $tabs, [
108 108
 			'databaseKey' => OptionManager::databaseKey(),
109 109
 			'settings' => glsr()->getDefaults(),
110
-		]);
110
+		] );
111 111
 	}
112 112
 
113 113
 	/**
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 			'import-export' => __( 'Import/Export', 'site-reviews' ),
123 123
 			'logging' => __( 'Logging', 'site-reviews' ),
124 124
 			'system-info' => __( 'System Info', 'site-reviews' ),
125
-		]);
125
+		] );
126 126
 		$this->renderMenu( 'tools', $tabs, [
127 127
 			'id' => Application::ID,
128 128
 			'logger' => glsr( Logger::class ),
129 129
 			'prefix' => Application::PREFIX,
130 130
 			'system' => glsr( System::class ),
131
-		]);
131
+		] );
132 132
 	}
133 133
 
134 134
 	/**
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	protected function getCurrentSection( array $tabs, $tab )
150 150
 	{
151 151
 		$currentSection = filter_input( INPUT_GET, 'section' );
152
-		if( empty( $tabs[$tab]['sections'][$currentSection] )) {
153
-			$currentSection = isset( $tabs[$tab]['sections'] )
152
+		if( empty($tabs[$tab]['sections'][$currentSection]) ) {
153
+			$currentSection = isset($tabs[$tab]['sections'])
154 154
 				? key( $tabs[$tab]['sections'] )
155 155
 				: '';
156 156
 		}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	protected function getCurrentTab( array $tabs )
164 164
 	{
165 165
 		$currentTab = filter_input( INPUT_GET, 'tab' );
166
-		if( !array_key_exists( $currentTab, $tabs )) {
166
+		if( !array_key_exists( $currentTab, $tabs ) ) {
167 167
 			$currentTab = key( $tabs );
168 168
 		}
169 169
 		return $currentTab;
@@ -175,16 +175,16 @@  discard block
 block discarded – undo
175 175
 	protected function normalizeTabs( array $tabs )
176 176
 	{
177 177
 		foreach( $tabs as $key => $value ) {
178
-			if( !is_array( $value )) {
178
+			if( !is_array( $value ) ) {
179 179
 				$value = ['title' => $value];
180 180
 			}
181 181
 			$tabs[$key] = wp_parse_args( $value, [
182 182
 				'sections' => [],
183 183
 				'title' => '',
184
-			]);
184
+			] );
185 185
 			$useLicenses = apply_filters( 'site-reviews/addon/licenses', false );
186 186
 			if( !$useLicenses ) {
187
-				unset( $tabs['licenses'] );
187
+				unset($tabs['licenses']);
188 188
 			}
189 189
 		}
190 190
 		return $tabs;
@@ -206,6 +206,6 @@  discard block
 block discarded – undo
206 206
 			'tabs' => $tabs,
207 207
 		];
208 208
 		$data = apply_filters( 'site-reviews/addon/page/data', $data, $defaults );
209
-		glsr()->render( 'pages/index', wp_parse_args( $data, $defaults ));
209
+		glsr()->render( 'pages/index', wp_parse_args( $data, $defaults ) );
210 210
 	}
211 211
 }
Please login to merge, or discard this patch.
plugin/Helper.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,9 @@
 block discarded – undo
166 166
 	{
167 167
 		$result = [];
168 168
 		foreach( $array as $key => $value ) {
169
-			if( !$value )continue;
169
+			if( !$value ) {
170
+				continue;
171
+			}
170 172
 			$result[$key] = is_array( $value )
171 173
 				? $this->removeEmptyArrayValues( $value )
172 174
 				: $value;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	public function buildClassName( $name, $path = '' )
16 16
 	{
17
-		$className = array_map( 'strtolower', (array)preg_split( '/[-_]/', $name ));
17
+		$className = array_map( 'strtolower', (array)preg_split( '/[-_]/', $name ) );
18 18
 		$className = array_map( 'ucfirst', $className );
19 19
 		$className = implode( '', $className );
20 20
 		$path = ltrim( str_replace( __NAMESPACE__, '', $path ), '\\' );
21
-		return !empty( $path )
21
+		return !empty($path)
22 22
 			? __NAMESPACE__.'\\'.$path.'\\'.$className
23 23
 			: $className;
24 24
 	}
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public function buildMethodName( $name, $prefix = '' )
32 32
 	{
33
-		return lcfirst( $prefix.$this->buildClassName( $name ));
33
+		return lcfirst( $prefix.$this->buildClassName( $name ) );
34 34
 	}
35 35
 
36 36
 	/**
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function buildPropertyName( $name )
41 41
 	{
42
-		return lcfirst( $this->buildClassName( $name ));
42
+		return lcfirst( $this->buildClassName( $name ) );
43 43
 	}
44 44
 
45 45
 	/**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public function dashCase( $string )
72 72
 	{
73
-		return str_replace( '_', '-', $this->snakeCase( $string ));
73
+		return str_replace( '_', '-', $this->snakeCase( $string ) );
74 74
 	}
75 75
 
76 76
 	/**
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 	{
95 95
 		$result = [];
96 96
 		foreach( $array as $key => $value ) {
97
-			$newKey = $prefix.( empty( $prefix ) ? '' : '.' ).$key;
98
-			if( $this->isIndexedArray( $value )) {
97
+			$newKey = $prefix.(empty($prefix) ? '' : '.').$key;
98
+			if( $this->isIndexedArray( $value ) ) {
99 99
 				$value = '['.implode( ', ', $value ).']';
100 100
 			}
101
-			if( is_array( $value )) {
102
-				$result = array_merge( $result, $this->flattenArray( $value, $newKey ));
101
+			if( is_array( $value ) ) {
102
+				$result = array_merge( $result, $this->flattenArray( $value, $newKey ) );
103 103
 				continue;
104 104
 			}
105 105
 			$result[$newKey] = $value;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 				Whip::IPV4 => $cloudflareIps['v4'],
119 119
 				Whip::IPV6 => $cloudflareIps['v6'],
120 120
 			],
121
-		]))->getValidIpAddress();
121
+		] ))->getValidIpAddress();
122 122
 	}
123 123
 
124 124
 	/**
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	{
132 132
 		$keys = explode( '.', $path );
133 133
 		foreach( $keys as $key ) {
134
-			if( !isset( $values[$key] )) {
134
+			if( !isset($values[$key]) ) {
135 135
 				return $fallback;
136 136
 			}
137 137
 			$values = $values[$key];
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 */
146 146
 	public function isIndexedArray( $array )
147 147
 	{
148
-		if( !is_array( $array ) || array_filter( $array, 'is_array' )) {
148
+		if( !is_array( $array ) || array_filter( $array, 'is_array' ) ) {
149 149
 			return false;
150 150
 		}
151 151
 		$current = 0;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 */
202 202
 	public function snakeCase( $string )
203 203
 	{
204
-		if( !ctype_lower( $string )) {
204
+		if( !ctype_lower( $string ) ) {
205 205
 			$string = preg_replace( '/\s+/u', '', $string );
206 206
 			$string = preg_replace( '/(.)(?=[A-Z])/u', '$1_', $string );
207 207
 			$string = mb_strtolower( $string, 'UTF-8' );
@@ -216,6 +216,6 @@  discard block
 block discarded – undo
216 216
 	 */
217 217
 	public function startsWith( $needle, $haystack )
218 218
 	{
219
-		return substr( $haystack, 0, strlen( $needle )) === $needle;
219
+		return substr( $haystack, 0, strlen( $needle ) ) === $needle;
220 220
 	}
221 221
 }
Please login to merge, or discard this patch.
plugin/Container.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
 	}
114 114
 
115 115
 	/**
116
-     * Bind a singleton instance to the container
116
+	 * Bind a singleton instance to the container
117 117
 	 * @param string $alias
118 118
 	 * @param callable|string|null $binding
119 119
 	 * @return void
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public static function load()
39 39
 	{
40
-		if( empty( static::$instance )) {
40
+		if( empty(static::$instance) ) {
41 41
 			static::$instance = new static;
42 42
 		}
43 43
 		return static::$instance;
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function __get( $property )
51 51
 	{
52
-		if( property_exists( $this, $property ) && !in_array( $property, static::PROTECTED_PROPERTIES )) {
52
+		if( property_exists( $this, $property ) && !in_array( $property, static::PROTECTED_PROPERTIES ) ) {
53 53
 			return $this->$property;
54 54
 		}
55
-		$constant = 'static::'.strtoupper( $this->make( Helper::class )->snakeCase( $property ));
56
-		if( defined( $constant )) {
55
+		$constant = 'static::'.strtoupper( $this->make( Helper::class )->snakeCase( $property ) );
56
+		if( defined( $constant ) ) {
57 57
 			return constant( $constant );
58 58
 		}
59
-		return isset( $this->storage[$property] )
59
+		return isset($this->storage[$property])
60 60
 			? $this->storage[$property]
61 61
 			: null;
62 62
 	}
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public function __set( $property, $value )
70 70
 	{
71
-		if( !property_exists( $this, $property ) || in_array( $property, static::PROTECTED_PROPERTIES )) {
71
+		if( !property_exists( $this, $property ) || in_array( $property, static::PROTECTED_PROPERTIES ) ) {
72 72
 			$this->storage[$property] = $value;
73 73
 		}
74
-		else if( !isset( $this->$property )) {
74
+		else if( !isset($this->$property) ) {
75 75
 			$this->$property = $value;
76 76
 		}
77 77
 		else {
78
-			throw new Exception( sprintf( 'The "%s" property cannot be changed once set.', $property ));
78
+			throw new Exception( sprintf( 'The "%s" property cannot be changed once set.', $property ) );
79 79
 		}
80 80
 	}
81 81
 
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function make( $abstract )
99 99
 	{
100
-		if( !isset( $this->services[$abstract] )) {
100
+		if( !isset($this->services[$abstract]) ) {
101 101
 			$abstract = $this->addNamespace( $abstract );
102 102
 		}
103
-		if( isset( $this->services[$abstract] )) {
103
+		if( isset($this->services[$abstract]) ) {
104 104
 			$abstract = $this->services[$abstract];
105 105
 		}
106
-		if( is_callable( $abstract )) {
106
+		if( is_callable( $abstract ) ) {
107 107
 			return call_user_func_array( $abstract, [$this] );
108 108
 		}
109
-		if( is_object( $abstract )) {
109
+		if( is_object( $abstract ) ) {
110 110
 			return $abstract;
111 111
 		}
112 112
 		return $this->resolve( $abstract );
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function singleton( $alias, $binding )
122 122
 	{
123
-		$this->bind( $alias, $this->make( $binding ));
123
+		$this->bind( $alias, $this->make( $binding ) );
124 124
 	}
125 125
 
126 126
 	/**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	protected function addNamespace( $abstract )
132 132
 	{
133
-		if( strpos( $abstract, __NAMESPACE__ ) === false && !class_exists( $abstract )) {
133
+		if( strpos( $abstract, __NAMESPACE__ ) === false && !class_exists( $abstract ) ) {
134 134
 			$abstract = __NAMESPACE__.'\\'.$abstract;
135 135
 		}
136 136
 		return $abstract;
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			throw new Exception( 'Target ['.$concrete.'] is not instantiable.' );
153 153
 		}
154 154
 		$constructor = $reflector->getConstructor();
155
-		if( empty( $constructor )) {
155
+		if( empty($constructor) ) {
156 156
 			return new $concrete;
157 157
 		}
158 158
 		return $reflector->newInstanceArgs(
Please login to merge, or discard this patch.
plugin/Application.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -153,7 +153,9 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	public function scheduleCronJob()
155 155
 	{
156
-		if( wp_next_scheduled( static::CRON_EVENT ))return;
156
+		if( wp_next_scheduled( static::CRON_EVENT )) {
157
+			return;
158
+		}
157 159
 		wp_schedule_event( time(), 'twicedaily', static::CRON_EVENT );
158 160
 	}
159 161
 
@@ -184,7 +186,9 @@  discard block
 block discarded – undo
184 186
 			|| !in_array( plugin_basename( $this->file ), $data['plugins'] )
185 187
 			|| $data['action'] != 'update'
186 188
 			|| $data['type'] != 'plugin'
187
-		)return;
189
+		) {
190
+			return;
191
+		}
188 192
 		$this->upgrade();
189 193
 	}
190 194
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function getDefaults()
68 68
 	{
69
-		if( empty( $this->defaults )) {
69
+		if( empty($this->defaults) ) {
70 70
 			$this->defaults = $this->make( DefaultsManager::class )->get();
71 71
 			$this->upgrade();
72 72
 		}
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function hasPermission()
80 80
 	{
81
-		return !$this->isAdmin() || ( $this->isAdmin() && current_user_can( static::CAPABILITY ));
81
+		return !$this->isAdmin() || ($this->isAdmin() && current_user_can( static::CAPABILITY ));
82 82
 	}
83 83
 
84 84
 	/**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		$types = apply_filters( 'site-reviews/addon/types', [] );
134 134
 		$this->reviewTypes = wp_parse_args( $types, [
135 135
 			'local' => __( 'Local', 'site-reviews' ),
136
-		]);
136
+		] );
137 137
 	}
138 138
 
139 139
 	/**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public function scheduleCronJob()
154 154
 	{
155
-		if( wp_next_scheduled( static::CRON_EVENT ))return;
155
+		if( wp_next_scheduled( static::CRON_EVENT ) )return;
156 156
 		wp_schedule_event( time(), 'twicedaily', static::CRON_EVENT );
157 157
 	}
158 158
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 */
162 162
 	public function unscheduleCronJob()
163 163
 	{
164
-		wp_unschedule_event( intval( wp_next_scheduled( static::CRON_EVENT )), static::CRON_EVENT );
164
+		wp_unschedule_event( intval( wp_next_scheduled( static::CRON_EVENT ) ), static::CRON_EVENT );
165 165
 	}
166 166
 
167 167
 	/**
@@ -193,6 +193,6 @@  discard block
 block discarded – undo
193 193
 	 */
194 194
 	public function url( $path = '' )
195 195
 	{
196
-		return esc_url( plugin_dir_url( $this->file ).ltrim( trim( $path ), '/' ));
196
+		return esc_url( plugin_dir_url( $this->file ).ltrim( trim( $path ), '/' ) );
197 197
 	}
198 198
 }
Please login to merge, or discard this patch.
plugin/Shortcodes/Shortcode.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,9 @@  discard block
 block discarded – undo
76 76
 		$args = shortcode_atts( $this->getDefaults(), wp_parse_args( $args ));
77 77
 		array_walk( $args, function( &$value, $key ) {
78 78
 			$methodName = glsr( Helper::class )->buildMethodName( $key, 'normalize' );
79
-			if( !method_exists( $this, $methodName ))return;
79
+			if( !method_exists( $this, $methodName )) {
80
+				return;
81
+			}
80 82
 			$value = $this->$methodName( $value );
81 83
 		});
82 84
 		return $this->sanitize( $args );
@@ -141,7 +143,9 @@  discard block
 block discarded – undo
141 143
 		$defaults = array_pad( $defaults, Rating::MAX_RATING, '' );
142 144
 		$labels = array_map( 'trim', explode( ',', $labels ));
143 145
 		foreach( $defaults as $i => $label ) {
144
-			if( empty( $labels[$i] ))continue;
146
+			if( empty( $labels[$i] )) {
147
+				continue;
148
+			}
145 149
 			$defaults[$i] = $labels[$i];
146 150
 		}
147 151
 		return array_combine( range( Rating::MAX_RATING, 1 ), $defaults );
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 			'after_widget' => '</div>',
28 28
 			'before_title' => '<h3 class="glsr-shortcode-title">',
29 29
 			'after_title' => '</h3>',
30
-		]);
30
+		] );
31 31
 		$instance = $this->normalize( $instance );
32 32
 		$partial = glsr( Html::class )->buildPartial( $shortcodePartial, $instance );
33
-		if( !empty( $instance['title'] )) {
33
+		if( !empty($instance['title']) ) {
34 34
 			$instance['title'] = $args['before_title'].$instance['title'].$args['after_title'];
35 35
 		}
36 36
 		return $args['before_widget'].$instance['title'].$partial.$args['after_widget'];
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function normalize( $args )
75 75
 	{
76
-		$args = shortcode_atts( $this->getDefaults(), wp_parse_args( $args ));
76
+		$args = shortcode_atts( $this->getDefaults(), wp_parse_args( $args ) );
77 77
 		array_walk( $args, function( &$value, $key ) {
78 78
 			$methodName = glsr( Helper::class )->buildMethodName( $key, 'normalize' );
79
-			if( !method_exists( $this, $methodName ))return;
79
+			if( !method_exists( $this, $methodName ) )return;
80 80
 			$value = $this->$methodName( $value );
81 81
 		});
82 82
 		return $this->sanitize( $args );
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	protected function normalizeHide( $hide )
110 110
 	{
111
-		if( is_string( $hide )) {
111
+		if( is_string( $hide ) ) {
112 112
 			$hide = explode( ',', $hide );
113 113
 		}
114 114
 		return array_filter( array_map( 'trim', $hide ), function( $value ) {
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 			__( 'Terrible', 'site-reviews' ),
140 140
 		];
141 141
 		$defaults = array_pad( $defaults, Rating::MAX_RATING, '' );
142
-		$labels = array_map( 'trim', explode( ',', $labels ));
142
+		$labels = array_map( 'trim', explode( ',', $labels ) );
143 143
 		foreach( $defaults as $i => $label ) {
144
-			if( empty( $labels[$i] ))continue;
144
+			if( empty($labels[$i]) )continue;
145 145
 			$defaults[$i] = $labels[$i];
146 146
 		}
147 147
 		return array_combine( range( Rating::MAX_RATING, 1 ), $defaults );
Please login to merge, or discard this patch.
plugin/Commands/RegisterPostType.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@
 block discarded – undo
29 29
 	{
30 30
 		foreach( $args as $key => $value ) {
31 31
 			$property = glsr( Helper::class )->buildPropertyName( $key );
32
-			if( !property_exists( $this, $property ))continue;
32
+			if( !property_exists( $this, $property )) {
33
+				continue;
34
+			}
33 35
 			$this->$property = $value;
34 36
 			unset( $args[$key] );
35 37
 		}
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 	{
30 30
 		foreach( $args as $key => $value ) {
31 31
 			$property = glsr( Helper::class )->buildPropertyName( $key );
32
-			if( !property_exists( $this, $property ))continue;
32
+			if( !property_exists( $this, $property ) )continue;
33 33
 			$this->$property = $value;
34
-			unset( $args[$key] );
34
+			unset($args[$key]);
35 35
 		}
36 36
 		$this->args = wp_parse_args( $args, [
37 37
 			'menu_name' => $this->plural,
38
-		]);
38
+		] );
39 39
 	}
40 40
 
41 41
 	/**
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 			'singular_name' => $this->single,
59 59
 			'uploaded_to_this_item' => sprintf( _x( 'Uploaded to this %s', 'Uploaded to this Post', 'site-reviews' ), $this->single ),
60 60
 			'view_item' => sprintf( _x( 'View %s', 'View Post', 'site-reviews' ), $this->single ),
61
-		]);
62
-		unset( $this->args['menu_name'] );
61
+		] );
62
+		unset($this->args['menu_name']);
63 63
 	}
64 64
 
65 65
 	/**
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 	protected function normalizeColumns()
69 69
 	{
70 70
 		$this->columns = ['cb' => ''] + $this->columns;
71
-		if( array_key_exists( 'category', $this->columns )) {
71
+		if( array_key_exists( 'category', $this->columns ) ) {
72 72
 			$keys = array_keys( $this->columns );
73 73
 			$keys[array_search( 'category', $keys )] = 'taxonomy-'.Application::TAXONOMY;
74 74
 			$this->columns = array_combine( $keys, $this->columns );
75 75
 		}
76
-		if( array_key_exists( 'pinned', $this->columns )) {
76
+		if( array_key_exists( 'pinned', $this->columns ) ) {
77 77
 			$stickyValue = '<span class="pinned-icon"><span>'.$this->columns['pinned'].'</span></span>';
78 78
 			$this->columns['pinned'] = $stickyValue;
79 79
 		}
Please login to merge, or discard this patch.
plugin/Modules/Html/Template.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@
 block discarded – undo
58 58
 	{
59 59
 		$args = shortcode_atts( array_fill_keys( ['context', 'globals'], [] ), $args );
60 60
 		foreach( $args as $key => $value ) {
61
-			if( is_array( $value ))continue;
61
+			if( is_array( $value )) {
62
+				continue;
63
+			}
62 64
 			$args[$key] = [];
63 65
 		}
64 66
 		return $args;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	{
15 15
 		$args = $this->normalize( $args );
16 16
 		$file = glsr()->path( 'views/'.$templatePath.'.php' );
17
-		if( !file_exists( $file )) {
17
+		if( !file_exists( $file ) ) {
18 18
 			glsr_log()->error( 'Template missing: '.$file );
19 19
 			return;
20 20
 		}
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	{
59 59
 		$args = shortcode_atts( array_fill_keys( ['context', 'globals'], [] ), $args );
60 60
 		foreach( $args as $key => $value ) {
61
-			if( is_array( $value ))continue;
61
+			if( is_array( $value ) )continue;
62 62
 			$args[$key] = [];
63 63
 		}
64 64
 		return $args;
Please login to merge, or discard this patch.
plugin/Modules/Html/Attributes.php 2 patches
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -181,7 +181,9 @@  discard block
 block discarded – undo
181 181
 				$key = $value;
182 182
 				$value = true;
183 183
 			}
184
-			if( !in_array( $key, static::BOOLEAN_ATTRIBUTES ))continue;
184
+			if( !in_array( $key, static::BOOLEAN_ATTRIBUTES )) {
185
+				continue;
186
+			}
185 187
 			$this->attributes[$key] = wp_validate_boolean( $value );
186 188
 		}
187 189
 	}
@@ -196,7 +198,9 @@  discard block
 block discarded – undo
196 198
 				$key = $value;
197 199
 				$value = '';
198 200
 			}
199
-			if( !glsr( Helper::class )->startsWith( 'data-', $key ))continue;
201
+			if( !glsr( Helper::class )->startsWith( 'data-', $key )) {
202
+				continue;
203
+			}
200 204
 			if( is_array( $value )) {
201 205
 				$value = json_encode( $value, JSON_HEX_APOS | JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES );
202 206
 			}
@@ -210,7 +214,9 @@  discard block
 block discarded – undo
210 214
 	protected function normalizeStringAttributes()
211 215
 	{
212 216
 		foreach( $this->attributes as $key => $value ) {
213
-			if( !is_string( $value ))continue;
217
+			if( !is_string( $value )) {
218
+				continue;
219
+			}
214 220
 			$this->attributes[$key] = trim( $value );
215 221
 		}
216 222
 	}
@@ -221,7 +227,9 @@  discard block
 block discarded – undo
221 227
 	 */
222 228
 	protected function normalizeInputType( $method )
223 229
 	{
224
-		if( $method != 'input' )return;
230
+		if( $method != 'input' ) {
231
+			return;
232
+		}
225 233
 		$attributes = wp_parse_args( $this->attributes, ['type' => ''] );
226 234
 		if( !in_array( $attributes['type'], static::INPUT_TYPES )) {
227 235
 			$this->attributes['type'] = 'text';
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	protected function filterAttributes( array $allowedAttributeKeys )
114 114
 	{
115
-		return array_intersect_key( $this->attributes, array_flip( $allowedAttributeKeys ));
115
+		return array_intersect_key( $this->attributes, array_flip( $allowedAttributeKeys ) );
116 116
 	}
117 117
 
118 118
 	/**
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		$globalAttributes = $this->filterAttributes( static::GLOBAL_ATTRIBUTES );
124 124
 		$wildcards = [];
125 125
 		foreach( static::GLOBAL_WILDCARD_ATTRIBUTES as $wildcard ) {
126
-			$newWildcards = array_filter( $this->attributes, function( $key ) use( $wildcard ) {
126
+			$newWildcards = array_filter( $this->attributes, function( $key ) use($wildcard) {
127 127
 				return glsr( Helper::class )->startsWith( $wildcard, $key );
128 128
 			}, ARRAY_FILTER_USE_KEY );
129 129
 			$wildcards = array_merge( $wildcards, $newWildcards );
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
 	protected function normalizeBooleanAttributes()
178 178
 	{
179 179
 		foreach( $this->attributes as $key => $value ) {
180
-			if( $this->isAttributeKeyNumeric( $key, $value )) {
180
+			if( $this->isAttributeKeyNumeric( $key, $value ) ) {
181 181
 				$key = $value;
182 182
 				$value = true;
183 183
 			}
184
-			if( !in_array( $key, static::BOOLEAN_ATTRIBUTES ))continue;
184
+			if( !in_array( $key, static::BOOLEAN_ATTRIBUTES ) )continue;
185 185
 			$this->attributes[$key] = wp_validate_boolean( $value );
186 186
 		}
187 187
 	}
@@ -192,12 +192,12 @@  discard block
 block discarded – undo
192 192
 	protected function normalizeDataAttributes()
193 193
 	{
194 194
 		foreach( $this->attributes as $key => $value ) {
195
-			if( $this->isAttributeKeyNumeric( $key, $value )) {
195
+			if( $this->isAttributeKeyNumeric( $key, $value ) ) {
196 196
 				$key = $value;
197 197
 				$value = '';
198 198
 			}
199
-			if( !glsr( Helper::class )->startsWith( 'data-', $key ))continue;
200
-			if( is_array( $value )) {
199
+			if( !glsr( Helper::class )->startsWith( 'data-', $key ) )continue;
200
+			if( is_array( $value ) ) {
201 201
 				$value = json_encode( $value, JSON_HEX_APOS | JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES );
202 202
 			}
203 203
 			$this->attributes[$key] = $value;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	protected function normalizeStringAttributes()
211 211
 	{
212 212
 		foreach( $this->attributes as $key => $value ) {
213
-			if( !is_string( $value ))continue;
213
+			if( !is_string( $value ) )continue;
214 214
 			$this->attributes[$key] = trim( $value );
215 215
 		}
216 216
 	}
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	{
224 224
 		if( $method != 'input' )return;
225 225
 		$attributes = wp_parse_args( $this->attributes, ['type' => ''] );
226
-		if( !in_array( $attributes['type'], static::INPUT_TYPES )) {
226
+		if( !in_array( $attributes['type'], static::INPUT_TYPES ) ) {
227 227
 			$this->attributes['type'] = 'text';
228 228
 		}
229 229
 	}
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
 		$dataAttributes = [];
238 238
 		foreach( $this->attributes as $key => $value ) {
239 239
 			if( in_array( $key, static::BOOLEAN_ATTRIBUTES ) && !$value ) {
240
-				unset( $attributes[$key] );
240
+				unset($attributes[$key]);
241 241
 			}
242
-			if( glsr( Helper::class )->startsWith( 'data-', $key )) {
242
+			if( glsr( Helper::class )->startsWith( 'data-', $key ) ) {
243 243
 				$dataAttributes[$key] = $value;
244
-				unset( $attributes[$key] );
244
+				unset($attributes[$key]);
245 245
 			}
246 246
 		}
247 247
 		$this->attributes = array_merge( array_filter( $attributes ), $dataAttributes );
Please login to merge, or discard this patch.
plugin/Modules/Html/Partials/Sections.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@
 block discarded – undo
24 24
 	public function build( $name, array $args = [] )
25 25
 	{
26 26
 		$this->normalize( $args );
27
-		if( count( $this->sections ) < 2 )return;
27
+		if( count( $this->sections ) < 2 ) {
28
+			return;
29
+		}
28 30
 		$links = array_reduce( array_keys( $this->sections ), function( $result, $section ) {
29 31
 			return $result.glsr( Builder::class )->li( $this->buildLink( $section ));
30 32
 		});
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		$this->normalize( $args );
27 27
 		if( count( $this->sections ) < 2 )return;
28 28
 		$links = array_reduce( array_keys( $this->sections ), function( $result, $section ) {
29
-			return $result.glsr( Builder::class )->li( $this->buildLink( $section ));
29
+			return $result.glsr( Builder::class )->li( $this->buildLink( $section ) );
30 30
 		});
31 31
 		return glsr( Builder::class )->ul( $links, ['class' => 'subsubsub glsr-subsubsub'] );
32 32
 	}
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			'section' => '',
42 42
 			'tab' => '',
43 43
 			'tabs' => [],
44
-		]);
44
+		] );
45 45
 		$this->sections = $this->args['tabs'][$this->args['tab']]['sections'];
46 46
 	}
47 47
 
@@ -61,6 +61,6 @@  discard block
 block discarded – undo
61 61
 		return glsr( Builder::class )->a( $this->sections[$section], [
62 62
 			'class' => $class,
63 63
 			'href' => '?post_type='.Application::POST_TYPE.'&page='.$this->args['page'].'&tab='.$this->args['tab'].'&section='.$section,
64
-		]).$separator;
64
+		] ).$separator;
65 65
 	}
66 66
 }
Please login to merge, or discard this patch.