Passed
Push — master ( 235569...65c96d )
by Paul
03:43
created
plugin/Widgets/SiteReviewsSummaryWidget.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,22 +20,22 @@  discard block
 block discarded – undo
20 20
 			'class' => 'widefat',
21 21
 			'label' => __( 'Title', 'site-reviews' ),
22 22
 			'name' => 'title',
23
-		]);
23
+		] );
24 24
 		if( count( glsr()->reviewTypes ) > 1 ) {
25 25
 			$this->renderField( 'select', [
26 26
 				'class' => 'widefat',
27 27
 				'label' => __( 'Which type of review would you like to use?', 'site-reviews' ),
28 28
 				'name' => 'type',
29 29
 				'options' => ['' => __( 'All review types', 'site-reviews' )] + glsr()->reviewTypes,
30
-			]);
30
+			] );
31 31
 		}
32
-		if( !empty( $terms )) {
32
+		if( !empty($terms) ) {
33 33
 			$this->renderField( 'select', [
34 34
 				'class' => 'widefat',
35 35
 				'label' => __( 'Limit summary to this category', 'site-reviews' ),
36 36
 				'name' => 'category',
37 37
 				'options' => ['' => __( 'All Categories', 'site-reviews' )] + $terms,
38
-			]);
38
+			] );
39 39
 		}
40 40
 		$this->renderField( 'text', [
41 41
 			'class' => 'widefat',
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 			'description' => sprintf( __( "Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews' ), '<code>post_id</code>' ),
44 44
 			'label' => __( 'Limit summary to reviews assigned to a page/post ID', 'site-reviews' ),
45 45
 			'name' => 'assigned_to',
46
-		]);
46
+		] );
47 47
 		$this->renderField( 'text', [
48 48
 			'class' => 'widefat',
49 49
 			'label' => __( 'Enter any custom CSS classes here', 'site-reviews' ),
50 50
 			'name' => 'class',
51
-		]);
51
+		] );
52 52
 		$this->renderField( 'checkbox', [
53 53
 			'name' => 'hide',
54 54
 			'options' => [
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 				'summary' => __( 'Hide the summary text?', 'site-reviews' ),
59 59
 				'if_empty' => __( 'Hide the summary if no reviews are found?', 'site-reviews' ),
60 60
 			],
61
-		]);
61
+		] );
62 62
 	}
63 63
 
64 64
 	/**
Please login to merge, or discard this patch.
plugin/Widgets/SiteReviewsFormWidget.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,30 +20,30 @@  discard block
 block discarded – undo
20 20
 			'class' => 'widefat',
21 21
 			'label' => __( 'Title', 'site-reviews' ),
22 22
 			'name' => 'title',
23
-		]);
23
+		] );
24 24
 		$this->renderField( 'textarea', [
25 25
 			'class' => 'widefat',
26 26
 			'label' => __( 'Description', 'site-reviews' ),
27 27
 			'name' => 'description',
28
-		]);
28
+		] );
29 29
 		$this->renderField( 'select', [
30 30
 			'class' => 'widefat',
31 31
 			'label' => __( 'Automatically assign a category', 'site-reviews' ),
32 32
 			'name' => 'category',
33 33
 			'options' => ['' => __( 'Do not assign a category', 'site-reviews' )] + $terms,
34
-		]);
34
+		] );
35 35
 		$this->renderField( 'text', [
36 36
 			'class' => 'widefat',
37 37
 			'default' => '',
38 38
 			'description' => sprintf( __( 'You may also enter %s to assign to the current post.', 'site-reviews' ), '<code>post_id</code>' ),
39 39
 			'label' => __( 'Assign reviews to a custom page/post ID', 'site-reviews' ),
40 40
 			'name' => 'assign_to',
41
-		]);
41
+		] );
42 42
 		$this->renderField( 'text', [
43 43
 			'class' => 'widefat',
44 44
 			'label' => __( 'Enter any custom CSS classes here', 'site-reviews' ),
45 45
 			'name' => 'class',
46
-		]);
46
+		] );
47 47
 		$this->renderField( 'checkbox', [
48 48
 			'name' => 'hide',
49 49
 			'options' => [
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 				'terms' => __( 'Hide the terms field', 'site-reviews' ),
53 53
 				'title' => __( 'Hide the title field', 'site-reviews' ),
54 54
 			],
55
-		]);
55
+		] );
56 56
 	}
57 57
 
58 58
 	/**
Please login to merge, or discard this patch.
plugin/Widgets/Widget.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@  discard block
 block discarded – undo
15 15
 	public function __construct( $idBase, $name, $values )
16 16
 	{
17 17
 		$controlOptions = $widgetOptions = [];
18
-		if( isset( $values['class'] )) {
18
+		if( isset($values['class']) ) {
19 19
 			$widgetOptions['classname'] = $values['class'];
20 20
 		}
21
-		if( isset( $values['description'] )) {
21
+		if( isset($values['description']) ) {
22 22
 			$widgetOptions['description'] = $values['description'];
23 23
 		}
24
-		if( isset( $values['width'] )) {
24
+		if( isset($values['width']) ) {
25 25
 			$controlOptions['width'] = $values['width'];
26 26
 		}
27 27
 		parent::__construct( $idBase, $name, $widgetOptions, $controlOptions );
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 	protected function renderField( $tag, array $args = [] )
35 35
 	{
36 36
 		$args = $this->normalizeFieldAttributes( $tag, $args );
37
-		$field = glsr( Builder::class )->{$tag}( $args['name'], $args );
37
+		$field = glsr( Builder::class )->{$tag}($args['name'], $args);
38 38
 		echo glsr( Builder::class )->div( $field, [
39 39
 			'class' => 'glsr-field',
40
-		]);
40
+		] );
41 41
 	}
42 42
 
43 43
 	/**
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	protected function normalizeFieldAttributes( $tag, array $args )
48 48
 	{
49
-		if( empty( $args['value'] )) {
49
+		if( empty($args['value']) ) {
50 50
 			$args['value'] = $this->widgetArgs[$args['name']];
51 51
 		}
52
-		if( empty( $this->widgetArgs['options'] ) && in_array( $tag, ['checkbox', 'radio'] )) {
52
+		if( empty($this->widgetArgs['options']) && in_array( $tag, ['checkbox', 'radio'] ) ) {
53 53
 			$args['checked'] = in_array( $args['value'], (array)$this->widgetArgs[$args['name']] );
54 54
 		}
55 55
 		$args['id'] = $this->get_field_id( $args['name'] );
Please login to merge, or discard this patch.
plugin/Shortcodes/SiteReviewsFormShortcode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@
 block discarded – undo
15 15
 	 */
16 16
 	protected function sanitize( array $args )
17 17
 	{
18
-		if( empty( $args['id'] )) {
19
-			$args['id'] = substr( md5( serialize( $args )), 0, 8 );
18
+		if( empty($args['id']) ) {
19
+			$args['id'] = substr( md5( serialize( $args ) ), 0, 8 );
20 20
 		}
21 21
 		return $args;
22 22
 	}
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/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/Container.php 1 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.