Passed
Push — master ( 57dde7...525778 )
by Paul
04:33
created
plugin/Shortcodes/SiteReviewsSummaryButton.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 	public function fields()
13 13
 	{
14 14
 		return [[
15
-			'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' )),
15
+			'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' ) ),
16 16
 			'minWidth' => 320,
17 17
 			'type' => 'container',
18
-		],[
18
+		], [
19 19
 			'label' => esc_html__( 'Title', 'site-reviews' ),
20 20
 			'name' => 'title',
21 21
 			'tooltip' => __( 'Enter a custom shortcode heading.', 'site-reviews' ),
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			'name' => 'assigned_to',
29 29
 			'tooltip' => __( 'Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page.', 'site-reviews' ),
30 30
 			'type' => 'textbox',
31
-		],[
31
+		], [
32 32
 			'label' => esc_html__( 'Schema', 'site-reviews' ),
33 33
 			'name' => 'schema',
34 34
 			'options' => [
@@ -37,34 +37,34 @@  discard block
 block discarded – undo
37 37
 			],
38 38
 			'tooltip' => __( 'Rich snippets are disabled by default.', 'site-reviews' ),
39 39
 			'type' => 'listbox',
40
-		],[
40
+		], [
41 41
 			'label' => esc_html__( 'Classes', 'site-reviews' ),
42 42
 			'name' => 'class',
43 43
 			'tooltip' => __( 'Add custom CSS classes to the shortcode.', 'site-reviews' ),
44 44
 			'type' => 'textbox',
45
-		],[
45
+		], [
46 46
 			'columns' => 2,
47 47
 			'items' => [[
48 48
 				'type' => 'checkbox',
49 49
 				'name' => 'hide_bars',
50 50
 				'text' => esc_html__( 'Bars', 'site-reviews' ),
51 51
 				'tooltip' => esc_attr__( 'Hide the percentage bars?', 'site-reviews' ),
52
-			],[
52
+			], [
53 53
 				'type' => 'checkbox',
54 54
 				'name' => 'hide_if_empty',
55 55
 				'text' => esc_html__( 'If Empty', 'site-reviews' ),
56 56
 				'tooltip' => esc_attr__( 'Hide the summary if no reviews are found?', 'site-reviews' ),
57
-			],[
57
+			], [
58 58
 				'type' => 'checkbox',
59 59
 				'name' => 'hide_rating',
60 60
 				'text' => esc_html__( 'Rating', 'site-reviews' ),
61 61
 				'tooltip' => esc_attr__( 'Hide the rating?', 'site-reviews' ),
62
-			],[
62
+			], [
63 63
 				'type' => 'checkbox',
64 64
 				'name' => 'hide_stars',
65 65
 				'text' => esc_html__( 'Stars', 'site-reviews' ),
66 66
 				'tooltip' => esc_attr__( 'Hide the stars?', 'site-reviews' ),
67
-			],[
67
+			], [
68 68
 				'type' => 'checkbox',
69 69
 				'name' => 'hide_summary',
70 70
 				'text' => esc_html__( 'Summary', 'site-reviews' ),
Please login to merge, or discard this patch.
plugin/Handlers/RegisterShortcodeButtons.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
 	{
15 15
 		foreach( $command->shortcodes as $slug => $label ) {
16 16
 			$buttonClass = glsr( Helper::class )->buildClassName( $slug.'-button', 'Shortcodes' );
17
-			if( !class_exists( $buttonClass )) {
18
-				glsr_log()->error( sprintf( 'Class missing (%s)', $buttonClass ));
17
+			if( !class_exists( $buttonClass ) ) {
18
+				glsr_log()->error( sprintf( 'Class missing (%s)', $buttonClass ) );
19 19
 				continue;
20 20
 			}
21 21
 			$shortcode = glsr( $buttonClass )->register( $slug, [
22 22
 				'label' => $label,
23 23
 				'title' => $label,
24
-			]);
24
+			] );
25 25
 			glsr()->mceShortcodes[$slug] = $shortcode->properties;
26 26
 		}
27 27
 	}
Please login to merge, or discard this patch.
plugin/Handlers/RegisterShortcodes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 	{
15 15
 		foreach( $command->shortcodes as $shortcode ) {
16 16
 			$shortcodeClass = glsr( Helper::class )->buildClassName( $shortcode.'-shortcode', 'Shortcodes' );
17
-			if( !class_exists( $shortcodeClass )) {
18
-				glsr_log()->error( sprintf( 'Class missing (%s)', $shortcodeClass ));
17
+			if( !class_exists( $shortcodeClass ) ) {
18
+				glsr_log()->error( sprintf( 'Class missing (%s)', $shortcodeClass ) );
19 19
 				continue;
20 20
 			}
21 21
 			add_shortcode( $shortcode, [glsr( $shortcodeClass ), 'buildShortcode'] );
Please login to merge, or discard this patch.
plugin/Handlers/RegisterWidgets.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 		global $wp_widget_factory;
17 17
 		foreach( $command->widgets as $key => $values ) {
18 18
 			$widgetClass = glsr( Helper::class )->buildClassName( $key.'-widget', 'Widgets' );
19
-			if( !class_exists( $widgetClass )) {
20
-				glsr_log()->error( sprintf( 'Class missing (%s)', $widgetClass ));
19
+			if( !class_exists( $widgetClass ) ) {
20
+				glsr_log()->error( sprintf( 'Class missing (%s)', $widgetClass ) );
21 21
 				continue;
22 22
 			}
23 23
 			// Here we bypass register_widget() in order to pass our custom values to the widget
Please login to merge, or discard this patch.
plugin/Handlers/RegisterPointers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 		$pointers = $this->generatePointers( $command->pointers );
17 17
 		wp_localize_script( Application::ID, 'site_reviews_pointers', [
18 18
 			'pointers' => $pointers,
19
-		]);
20
-		if( empty( $pointers ))return;
19
+		] );
20
+		if( empty($pointers) )return;
21 21
 		wp_enqueue_style( 'wp-pointer' );
22 22
 		wp_enqueue_script( 'wp-pointer' );
23 23
 	}
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		$generatedPointers = [];
33 33
 		foreach( $pointers as $pointer ) {
34 34
 			if( $pointer['screen'] != glsr_current_screen()->id )continue;
35
-			if( in_array( $pointer['id'], $dismissedPointers ))continue;
35
+			if( in_array( $pointer['id'], $dismissedPointers ) )continue;
36 36
 			$generatedPointers[] = $this->generatePointer( $pointer );
37 37
 		}
38 38
 		return $generatedPointers;
Please login to merge, or discard this patch.
plugin/Handlers/RegisterPostType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 	 */
12 12
 	public function handle( Command $command )
13 13
 	{
14
-		if( in_array( $command->postType, get_post_types( ['_builtin' => true] )))return;
14
+		if( in_array( $command->postType, get_post_types( ['_builtin' => true] ) ) )return;
15 15
 		register_post_type( $command->postType, $command->args );
16 16
 		glsr()->postTypeColumns = wp_parse_args( glsr()->postTypeColumns, [
17 17
 			$command->postType => $command->columns,
18
-		]);
18
+		] );
19 19
 	}
20 20
 }
Please login to merge, or discard this patch.
plugin/Handlers/TogglePinned.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
12 12
 	 */
13 13
 	public function handle( Command $command )
14 14
 	{
15
-		if( !get_post( $command->id )) {
15
+		if( !get_post( $command->id ) ) {
16 16
 			return false;
17 17
 		}
18
-		if( is_null( $command->pinned )) {
18
+		if( is_null( $command->pinned ) ) {
19 19
 			$meta = get_post_meta( $command->id, 'pinned', true );
20 20
 			$command->pinned = !wp_validate_boolean( $meta );
21 21
 		}
Please login to merge, or discard this patch.
plugin/Handlers/EnqueueAdminAssets.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		$dependencies = []; //glsr( Html::class )->getDependencies();
63 63
 		$dependencies = array_merge( $dependencies, [
64 64
 			'jquery', 'jquery-ui-sortable', 'underscore', 'wp-util',
65
-		]);
65
+		] );
66 66
 		return $dependencies;
67 67
 	}
68 68
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	protected function isCurrentScreen()
73 73
 	{
74 74
 		$screen = glsr_current_screen();
75
-		return $screen && ( $screen->post_type == Application::POST_TYPE
75
+		return $screen && ($screen->post_type == Application::POST_TYPE
76 76
 			|| $screen->base == 'post'
77 77
 			|| $screen->id == 'dashboard'
78 78
 			|| $screen->id == 'widgets'
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	{
87 87
 		$variables = [];
88 88
 		foreach( glsr()->mceShortcodes as $tag => $args ) {
89
-			if( empty( $args['required'] ))continue;
89
+			if( empty($args['required']) )continue;
90 90
 			$variables[$tag] = $args['required'];
91 91
 		}
92 92
 		return $variables;
Please login to merge, or discard this patch.
plugin/Controllers/MainController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	public function registerPostType()
21 21
 	{
22 22
 		if( !glsr()->hasPermission() )return;
23
-		$command = new RegisterPostType([
23
+		$command = new RegisterPostType( [
24 24
 			'capabilities'=> ['create_posts' => 'create_'.Application::POST_TYPE],
25 25
 			'columns' => [
26 26
 				'title' => '',
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 			'plural' => __( 'Reviews', 'site-reviews' ),
39 39
 			'post_type' => Application::POST_TYPE,
40 40
 			'single' => __( 'Review', 'site-reviews' ),
41
-		]);
41
+		] );
42 42
 		$this->execute( $command );
43 43
 	}
44 44
 
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public function registerShortcodes()
50 50
 	{
51
-		$command = new RegisterShortcodes([
51
+		$command = new RegisterShortcodes( [
52 52
 			'site_reviews',
53 53
 			'site_reviews_form',
54 54
 			'site_reviews_summary',
55
-		]);
55
+		] );
56 56
 		$this->execute( $command );
57 57
 	}
58 58
 
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function registerTaxonomy()
64 64
 	{
65
-		$command = new RegisterTaxonomy([
65
+		$command = new RegisterTaxonomy( [
66 66
 			'hierarchical' => true,
67 67
 			'meta_box_cb' => 'glsr_categories_meta_box',
68 68
 			'public' => false,
69 69
 			'show_admin_column' => true,
70 70
 			'show_ui' => true,
71
-		]);
71
+		] );
72 72
 		$this->execute( $command );
73 73
 	}
74 74
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function registerWidgets()
80 80
 	{
81
-		$command = new RegisterWidgets([
81
+		$command = new RegisterWidgets( [
82 82
 			'site-reviews' => [
83 83
 				'class' => 'glsr-widget glsr-widget-site-reviews',
84 84
 				'description' => __( 'Your site’s most recent reviews.', 'site-reviews' ),
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 				'description' => __( 'A summary of your site’s reviews.', 'site-reviews' ),
95 95
 				'title' => __( 'Summary of Reviews', 'site-reviews' ),
96 96
 			],
97
-		]);
97
+		] );
98 98
 		$this->execute( $command );
99 99
 	}
100 100
 
Please login to merge, or discard this patch.