Completed
Pull Request — staging (#840)
by
unknown
17:30
created
src/View/PostEscapedView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 	 * @return string Rendered HTML.
56 56
 	 * @throws FailedToLoadView If the View URI could not be loaded.
57 57
 	 */
58
-	public function render( array $context = [] ) {
58
+	public function render( array $context = [ ] ) {
59 59
 		return wp_kses_post( $this->view->render( $context ) );
60 60
 	}
61 61
 
Please login to merge, or discard this patch.
src/View/View.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 	 * @return string Rendered HTML.
34 34
 	 * @throws FailedToLoadView If the View URI could not be loaded.
35 35
 	 */
36
-	public function render( array $context = [] );
36
+	public function render( array $context = [ ] );
37 37
 
38 38
 	/**
39 39
 	 * Render a partial view.
Please login to merge, or discard this patch.
src/Shortcode/BaseShortcode.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	public function register() {
41 41
 		$this->register_assets();
42 42
 
43
-		add_action( 'init', function () {
43
+		add_action( 'init', function() {
44 44
 			add_shortcode( $this->get_tag(), [ $this, 'process_shortcode' ] );
45 45
 		} );
46 46
 	}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @return string Rendered HTML.
72 72
 	 */
73
-	public function render( array $context = [] ) {
73
+	public function render( array $context = [ ] ) {
74 74
 		try {
75 75
 			$this->enqueue_assets();
76 76
 			$view = new PostEscapedView( new TemplatedView( $this->get_view_uri() ) );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @return array Context to pass onto view.
111 111
 	 */
112 112
 	protected function get_context( array $atts ) {
113
-		return [];
113
+		return [ ];
114 114
 	}
115 115
 
116 116
 	/**
Please login to merge, or discard this patch.
src/View/FormEscapedView.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 *
95 95
 	 * @var array
96 96
 	 */
97
-	private $allowed_tags = [];
97
+	private $allowed_tags = [ ];
98 98
 
99 99
 	/**
100 100
 	 * Instantiate a FormEscapedView object.
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * @return string Rendered HTML.
142 142
 	 * @throws FailedToLoadView If the View URI could not be loaded.
143 143
 	 */
144
-	public function render( array $context = [] ) {
144
+	public function render( array $context = [ ] ) {
145 145
 		return wp_kses( $this->view->render( $context ), $this->allowed_tags );
146 146
 	}
147 147
 
Please login to merge, or discard this patch.
src/Model/OptinForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * @return bool Whether the form was successfully updated.
49 49
 	 */
50 50
 	public function update_form( $form_id, $data ) {
51
-		$data['id'] = $form_id;
51
+		$data[ 'id' ] = $form_id;
52 52
 		$all_forms  = $this->get_all_forms();
53 53
 
54 54
 		if ( ! isset( $all_forms[ $form_id ] ) ) {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 		$all_ids         = $this->get_form_ids();
80 80
 		$last_id         = end( $all_ids );
81 81
 		$new_id          = false === $last_id ? 1 : $last_id + 1;
82
-		$form_data['id'] = $new_id;
82
+		$form_data[ 'id' ] = $new_id;
83 83
 
84 84
 		// Ensure our data is consistently sorted
85 85
 		ksort( $form_data );
Please login to merge, or discard this patch.
src/Exception/InvalidRecaptcha.php 3 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,6 @@  discard block
 block discarded – undo
23 23
 	 *
24 24
 	 * @since %VERSION%
25 25
 	 *
26
-	 * @param string $field Class name of the service that was not recognized.
27 26
 	 *
28 27
 	 * @return static
29 28
 	 */
@@ -41,7 +40,6 @@  discard block
 block discarded – undo
41 40
 	 *
42 41
 	 * @since %VERSION%
43 42
 	 *
44
-	 * @param string $field Class name of the service that was not recognized.
45 43
 	 *
46 44
 	 * @return static
47 45
 	 */
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,25 +29,25 @@
 block discarded – undo
29 29
 	 */
30 30
 	public static function from_site_key() {
31 31
 		$message = sprintf(
32
-            __( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
32
+				__( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
33 33
 		);
34 34
 
35 35
 		return new static( $message );
36 36
 	}
37 37
 
38
-    /**
39
-	 * Create a new instance of the exception for a field class name that is
40
-	 * not recognized.
41
-	 *
42
-	 * @since %VERSION%
43
-	 *
44
-	 * @param string $field Class name of the service that was not recognized.
45
-	 *
46
-	 * @return static
47
-	 */
38
+	 /**
39
+	  * Create a new instance of the exception for a field class name that is
40
+	  * not recognized.
41
+	  *
42
+	  * @since %VERSION%
43
+	  *
44
+	  * @param string $field Class name of the service that was not recognized.
45
+	  *
46
+	  * @return static
47
+	  */
48 48
 	public static function from_secret_key() {
49 49
 		$message = sprintf(
50
-            __( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
50
+				__( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
51 51
 		);
52 52
 
53 53
 		return new static( $message );
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public static function from_site_key() {
31 31
 		$message = sprintf(
32
-            __( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
32
+            __( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!', 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
33 33
 		);
34 34
 
35 35
 		return new static( $message );
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public static function from_secret_key() {
49 49
 		$message = sprintf(
50
-            __( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
50
+            __( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!', 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
51 51
 		);
52 52
 
53 53
 		return new static( $message );
Please login to merge, or discard this patch.
src/Field/BaseInput.php 4 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
 
10 10
 namespace YIKES\EasyForms\Field;
11 11
 
12
-use YIKES\EasyForms\Exception\MustExtend;
13
-
14 12
 /**
15 13
  * Class BaseInput
16 14
  *
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 	}
103 103
 
104 104
 	public function get_id() {
105
-        return 'yikes-easy-mc-form-' . $this->form_id . '-' . $this->merge;
106
-    }
105
+		  return 'yikes-easy-mc-form-' . $this->form_id . '-' . $this->merge;
106
+	 }
107 107
 
108 108
 	public function get_value() {
109 109
 		return $this->value;
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		</p>
140 140
 
141 141
         <?php
142
-        endif;
142
+		  endif;
143 143
 		?>
144 144
 		<input type="<?= esc_attr( $this->get_type() ); ?>"
145 145
 			class="<?= esc_attr( implode( ' ' , $this->field_classes() ) ); ?>"
Please login to merge, or discard this patch.
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -57,10 +57,8 @@
 block discarded – undo
57 57
 	/**
58 58
 	 * Construct Field
59 59
 	 *
60
-	 * @param string $id          Fields ID.
61 60
 	 * @param array  $classes     Field and label classes.
62 61
 	 * @param string $placeholder Fields placeholder.
63
-	 * @param string $name        Field name.
64 62
 	 */
65 63
 	public function __construct( $classes, $placeholder, $label, $value, $description, $merge, $form_id, $hidden, $required ) {
66 64
 		$this->classes     = $classes;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 *
32 32
 	 * @var array
33 33
 	 */
34
-	private $classes = [];
34
+	private $classes = [ ];
35 35
 
36 36
 	/**
37 37
 	 * Field placeholder.
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 		$this->placeholder = $placeholder;
68 68
 		$this->label       = $label;
69 69
 		$this->value       = $value;
70
-		$this->description = $description['description'];
71
-		$this->show_desc   = $description['show_description'];
72
-		$this->desc_above  = $description['description_above'];
70
+		$this->description = $description[ 'description' ];
71
+		$this->show_desc   = $description[ 'show_description' ];
72
+		$this->desc_above  = $description[ 'description_above' ];
73 73
 		$this->merge       = $merge;
74 74
 		$this->form_id     = $form_id;
75 75
 		$this->hidden      = $hidden;
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 
95 95
 	public function field_classes() {
96
-		return $this->classes['field_classes'];
96
+		return $this->classes[ 'field_classes' ];
97 97
 	}
98 98
 
99 99
 	public function label_classes() {
100 100
 		if ( true === static::REQUIRED ) {
101
-			$this->classes['label_classes'][] = 'yikes-mailchimp-field-required';
101
+			$this->classes[ 'label_classes' ][ ] = 'yikes-mailchimp-field-required';
102 102
 		}
103
-		return $this->classes['label_classes'];
103
+		return $this->classes[ 'label_classes' ];
104 104
 	}
105 105
 
106 106
 	public function get_required() {
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 	public function render() {
131 131
 
132 132
 		?>
133
-		<label for="<?= esc_attr( $this->get_id() ); ?>" class="<?= esc_html( implode( ' ' , $this->label_classes() ) ); ?>" <?= esc_html( implode( ' ' , $this->label['props'] ) ); ?> >
133
+		<label for="<?= esc_attr( $this->get_id() ); ?>" class="<?= esc_html( implode( ' ', $this->label_classes() ) ); ?>" <?= esc_html( implode( ' ', $this->label[ 'props' ] ) ); ?> >
134 134
 
135 135
 		<!-- dictate label visibility -->
136
-		<?php if ( ! isset( $this->label['hide-label'] ) ) { ?>
136
+		<?php if ( ! isset( $this->label[ 'hide-label' ] ) ) { ?>
137 137
 			<span class="<?= esc_attr( $this->merge ) . '-label'; ?>">
138
-				<?= esc_html( apply_filters( 'yikes-mailchimp-'. $this->merge .'-label' , esc_attr( $this->label['value'] ), $this->form_id ) ); ?>
138
+				<?= esc_html( apply_filters( 'yikes-mailchimp-' . $this->merge . '-label', esc_attr( $this->label[ 'value' ] ), $this->form_id ) ); ?>
139 139
 			</span>
140 140
 		<?php }
141 141
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         endif;
151 151
 		?>
152 152
 		<input type="<?= esc_attr( $this->get_type() ); ?>"
153
-			class="<?= esc_attr( implode( ' ' , $this->field_classes() ) ); ?>"
153
+			class="<?= esc_attr( implode( ' ', $this->field_classes() ) ); ?>"
154 154
 			name="<?= esc_attr( $this->get_name() ); ?>"
155 155
 			placeholder="<?= esc_attr( $this->get_placeholder() ); ?>"
156 156
 			id="<?= esc_attr( $this->get_id() ); ?>"
Please login to merge, or discard this patch.
src/Field/Hidden.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
 
10 10
 namespace YIKES\EasyForms\Field;
11 11
 
12
-use YIKES\EasyForms\Exception\InvalidField;
13
-
14 12
 /**
15 13
  * Class Hidden
16 14
  *
Please login to merge, or discard this patch.
src/Recaptcha/Recaptcha.php 4 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use YIKES\EasyForms\Assets\AssetsAwareness;
14 14
 use YIKES\EasyForms\Assets\ScriptAsset;
15 15
 use YIKES\EasyForms\Service;
16
-use YIKES\EasyForms\View\View;
17 16
 use YIKES\EasyForms\Model\Recaptcha as RecaptchaModel;
18 17
 
19 18
 /**
Please login to merge, or discard this patch.
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -23,42 +23,42 @@  discard block
 block discarded – undo
23 23
  */
24 24
 final class Recaptcha implements Service, AssetsAware {
25 25
 
26
-    use AssetsAwareness;
26
+	 use AssetsAwareness;
27 27
 
28
-    const VIEW_URI        = 'views/recaptcha-box';
29
-    const JS_HANDLE       = 'google-recaptcha-js';
30
-    const JS_URI          = 'https://www.google.com/recaptcha/api.js';
31
-    const JS_DEPENDENCIES = [ 'jquery', 'form-submission-helpers' ];
32
-    const JS_VERSION      = '1.0.0';
28
+	 const VIEW_URI        = 'views/recaptcha-box';
29
+	 const JS_HANDLE       = 'google-recaptcha-js';
30
+	 const JS_URI          = 'https://www.google.com/recaptcha/api.js';
31
+	 const JS_DEPENDENCIES = [ 'jquery', 'form-submission-helpers' ];
32
+	 const JS_VERSION      = '1.0.0';
33 33
 
34
-    public function register() {
35
-        $this->register_assets();
34
+	 public function register() {
35
+		  $this->register_assets();
36 36
 
37
-        add_action( 'easy_forms_do_recaptcha_box', function( $view ) {
38
-            $this->enqueue_assets();
39
-            echo $view->render_partial( static::VIEW_URI ); // phpcs:ignore WordPress.Security.EscapeOutput
40
-        } );
41
-    }
37
+		  add_action( 'easy_forms_do_recaptcha_box', function( $view ) {
38
+				$this->enqueue_assets();
39
+				echo $view->render_partial( static::VIEW_URI ); // phpcs:ignore WordPress.Security.EscapeOutput
40
+		  } );
41
+	 }
42 42
 
43
-     /**
44
-	 * Get the context to pass onto the view.
45
-	 *
46
-	 * Override to provide data to the view.
47
-	 *
48
-	 * @since %VERSION%
49
-	 *
50
-	 * @return array Context to pass onto view.
51
-	 */
43
+	  /**
44
+	   * Get the context to pass onto the view.
45
+	   *
46
+	   * Override to provide data to the view.
47
+	   *
48
+	   * @since %VERSION%
49
+	   *
50
+	   * @return array Context to pass onto view.
51
+	   */
52 52
 	protected function get_context() {
53 53
 		return $this->recaptcha['recaptcha_options'];
54
-    }
54
+	 }
55 55
     
56
-    private function get_script_params() {
57
-        $recaptcha_options = ( new RecaptchaModel() )->setup();
58
-        return $recaptcha_options['script_params'];
59
-    }
56
+	 private function get_script_params() {
57
+		  $recaptcha_options = ( new RecaptchaModel() )->setup();
58
+		  return $recaptcha_options['script_params'];
59
+	 }
60 60
 
61
-    public function __get( $name ) {
61
+	 public function __get( $name ) {
62 62
 		switch ( $name ) {
63 63
 			case 'script_params':
64 64
 				return $this->get_script_params();
@@ -66,23 +66,23 @@  discard block
 block discarded – undo
66 66
 			default:
67 67
 				return null;
68 68
 		}
69
-    }
69
+	 }
70 70
 
71
-    /**
72
-	 * Load asset objects for use.
73
-	 *
74
-	 * @since %SINCE%
75
-	 */
71
+	 /**
72
+	  * Load asset objects for use.
73
+	  *
74
+	  * @since %SINCE%
75
+	  */
76 76
 	protected function load_assets() {  
77 77
 		$this->assets= [
78 78
 			new ScriptAsset(
79
-                self::JS_HANDLE,
80
-                self::JS_URI . $this->script_params,
81
-                self::JS_DEPENDENCIES,
82
-                self::JS_VERSION,
83
-                ScriptAsset::ENQUEUE_HEADER,
84
-                true
85
-            ),
79
+					 self::JS_HANDLE,
80
+					 self::JS_URI . $this->script_params,
81
+					 self::JS_DEPENDENCIES,
82
+					 self::JS_VERSION,
83
+					 ScriptAsset::ENQUEUE_HEADER,
84
+					 true
85
+				),
86 86
 		];
87
-    }
87
+	 }
88 88
 }
89 89
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 	 * @return array Context to pass onto view.
51 51
 	 */
52 52
 	protected function get_context() {
53
-		return $this->recaptcha['recaptcha_options'];
53
+		return $this->recaptcha[ 'recaptcha_options' ];
54 54
     }
55 55
     
56 56
     private function get_script_params() {
57 57
         $recaptcha_options = ( new RecaptchaModel() )->setup();
58
-        return $recaptcha_options['script_params'];
58
+        return $recaptcha_options[ 'script_params' ];
59 59
     }
60 60
 
61 61
     public function __get( $name ) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 * @since %SINCE%
75 75
 	 */
76 76
 	protected function load_assets() {  
77
-		$this->assets= [
77
+		$this->assets = [
78 78
 			new ScriptAsset(
79 79
                 self::JS_HANDLE,
80 80
                 self::JS_URI . $this->script_params,
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 	 *
74 74
 	 * @since %SINCE%
75 75
 	 */
76
-	protected function load_assets() {  
76
+	protected function load_assets() {
77 77
 		$this->assets= [
78 78
 			new ScriptAsset(
79 79
                 self::JS_HANDLE,
Please login to merge, or discard this patch.