Completed
Pull Request — staging (#840)
by
unknown
15:23
created
src/View/BaseView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @var array
62 62
 	 */
63
-	protected $_context_ = [];
63
+	protected $_context_ = [ ];
64 64
 
65 65
 	/**
66 66
 	 * Instantiate a View object.
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @return string Rendered HTML.
86 86
 	 * @throws FailedToLoadView If the View URI could not be loaded.
87 87
 	 */
88
-	public function render( array $context = [] ) {
88
+	public function render( array $context = [ ] ) {
89 89
 
90 90
 		// Add context to the current instance to make it available within the
91 91
 		// rendered view.
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	public function render_partial( $uri, array $context = null ) {
141 141
 		$view = new static( $uri );
142 142
 
143
-		return $view->render( $context ?: $this->_context_ );
143
+		return $view->render( $context ? : $this->_context_ );
144 144
 	}
145 145
 
146 146
 	/**
Please login to merge, or discard this patch.
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/Shortcode/EasyFormsShortcode.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 final class EasyFormsShortcode extends BaseShortcode {
33 33
 
34
-    const TAG           = 'yikes-mailchimp';
34
+    const TAG = 'yikes-mailchimp';
35 35
 	const VIEW_URI      = 'views/easy-forms-shortcode';
36 36
 	const SUBMITTED_URI = 'views/easy-forms-shortcode-completed';
37 37
 
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
 	 * @throws InvalidPostID When the post ID is not valid.
107 107
 	 */
108 108
 	protected function get_context( array $atts ) {
109
-		$optin_form = ( new OptinFormRepository() )->find( $atts['form'] );
109
+		$optin_form = ( new OptinFormRepository() )->find( $atts[ 'form' ] );
110 110
 		/** @todo Recaptcha Settings. */
111 111
 		$this->is_submitted = $this->is_submitting_form();
112 112
 		// Set up the classes we'll use for the form and the individual fields.
113
-		$form_classes = $optin_form['form_settings']['yikes-easy-mc-form-class-names'];
113
+		$form_classes = $optin_form[ 'form_settings' ][ 'yikes-easy-mc-form-class-names' ];
114 114
 
115 115
 		// Set up the form object.
116 116
 		$form = $this->get_optin_form( $optin_form->get_id(), $optin_form, $field_classes );
117 117
 		return [
118
-			'form_settings' => $optin_form['form_settings'],
118
+			'form_settings' => $optin_form[ 'form_settings' ],
119 119
 			'optin_form'    => $optin_form,
120 120
 			'form_id'       => $optin_form->get_id(),
121 121
 			'form_classes'  => $form_classes,
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 *
191 191
 	 * @return string Rendered HTML.
192 192
 	 */
193
-	public function render( array $context = [] ) {
193
+	public function render( array $context = [ ] ) {
194 194
 		try {
195 195
 			$this->enqueue_assets();
196 196
 			$view = new FormEscapedView( new NoOverrideLocationView( $this->get_view_uri() ) );
Please login to merge, or discard this patch.