Passed
Push — master ( beaeba...f2ee52 )
by Brian
05:00
created
includes/data-stores/class-getpaid-data-store.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-defined( 'ABSPATH' ) || exit;
7
+defined('ABSPATH') || exit;
8 8
 
9 9
 /**
10 10
  * Data store class.
@@ -54,31 +54,31 @@  discard block
 block discarded – undo
54 54
 	 *
55 55
 	 * @param string $object_type Name of object.
56 56
 	 */
57
-	public function __construct( $object_type ) {
57
+	public function __construct($object_type) {
58 58
 		$this->object_type = $object_type;
59
-		$this->stores      = apply_filters( 'getpaid_data_stores', $this->stores );
59
+		$this->stores      = apply_filters('getpaid_data_stores', $this->stores);
60 60
 
61 61
 		// If this object type can't be found, check to see if we can load one
62 62
 		// level up (so if item-type isn't found, we try item).
63
-		if ( ! array_key_exists( $object_type, $this->stores ) ) {
64
-			$pieces      = explode( '-', $object_type );
63
+		if (!array_key_exists($object_type, $this->stores)) {
64
+			$pieces      = explode('-', $object_type);
65 65
 			$object_type = $pieces[0];
66 66
 		}
67 67
 
68
-		if ( array_key_exists( $object_type, $this->stores ) ) {
69
-			$store = apply_filters( 'getpaid_' . $object_type . '_data_store', $this->stores[ $object_type ] );
70
-			if ( is_object( $store ) ) {
71
-				$this->current_class_name = get_class( $store );
68
+		if (array_key_exists($object_type, $this->stores)) {
69
+			$store = apply_filters('getpaid_' . $object_type . '_data_store', $this->stores[$object_type]);
70
+			if (is_object($store)) {
71
+				$this->current_class_name = get_class($store);
72 72
 				$this->instance           = $store;
73 73
 			} else {
74
-				if ( ! class_exists( $store ) ) {
75
-					throw new Exception( __( 'Data store class does not exist.', 'invoicing' ) );
74
+				if (!class_exists($store)) {
75
+					throw new Exception(__('Data store class does not exist.', 'invoicing'));
76 76
 				}
77 77
 				$this->current_class_name = $store;
78 78
 				$this->instance           = new $store();
79 79
 			}
80 80
 		} else {
81
-			throw new Exception( __( 'Invalid data store.', 'invoicing' ) );
81
+			throw new Exception(__('Invalid data store.', 'invoicing'));
82 82
 		}
83 83
 	}
84 84
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @return array
89 89
 	 */
90 90
 	public function __sleep() {
91
-		return array( 'object_type' );
91
+		return array('object_type');
92 92
 	}
93 93
 
94 94
 	/**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 * @throws Exception When validation fails.
98 98
 	 */
99 99
 	public function __wakeup() {
100
-		$this->__construct( $this->object_type );
100
+		$this->__construct($this->object_type);
101 101
 	}
102 102
 
103 103
 	/**
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 	 * @throws Exception When validation fails.
110 110
 	 * @return GetPaid_Data_Store
111 111
 	 */
112
-	public static function load( $object_type ) {
113
-		return new GetPaid_Data_Store( $object_type );
112
+	public static function load($object_type) {
113
+		return new GetPaid_Data_Store($object_type);
114 114
 	}
115 115
 
116 116
 	/**
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 	 * @since 1.0.19
140 140
 	 * @param GetPaid_Data $data GetPaid data instance.
141 141
 	 */
142
-	public function read( &$data ) {
143
-		$this->instance->read( $data );
142
+	public function read(&$data) {
143
+		$this->instance->read($data);
144 144
 	}
145 145
 
146 146
 	/**
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	 * @since 1.0.19
150 150
 	 * @param GetPaid_Data $data GetPaid data instance.
151 151
 	 */
152
-	public function create( &$data ) {
153
-		$this->instance->create( $data );
152
+	public function create(&$data) {
153
+		$this->instance->create($data);
154 154
 	}
155 155
 
156 156
 	/**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
 	 * @since 1.0.19
160 160
 	 * @param GetPaid_Data $data GetPaid data instance.
161 161
 	 */
162
-	public function update( &$data ) {
163
-		$this->instance->update( $data );
162
+	public function update(&$data) {
163
+		$this->instance->update($data);
164 164
 	}
165 165
 
166 166
 	/**
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 	 * @param GetPaid_Data $data GetPaid data instance.
171 171
 	 * @param array   $args Array of args to pass to the delete method.
172 172
 	 */
173
-	public function delete( &$data, $args = array() ) {
174
-		$this->instance->delete( $data, $args );
173
+	public function delete(&$data, $args = array()) {
174
+		$this->instance->delete($data, $args);
175 175
 	}
176 176
 
177 177
 	/**
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
 	 * @param string $method     Method.
183 183
 	 * @return mixed
184 184
 	 */
185
-	public function __call( $method, $parameters ) {
186
-		if ( is_callable( array( $this->instance, $method ) ) ) {
187
-			$object     = array_shift( $parameters );
188
-			$parameters = array_merge( array( &$object ), $parameters );
189
-			return call_user_func_array( array( $this->instance, $method ), $parameters );
185
+	public function __call($method, $parameters) {
186
+		if (is_callable(array($this->instance, $method))) {
187
+			$object     = array_shift($parameters);
188
+			$parameters = array_merge(array(&$object), $parameters);
189
+			return call_user_func_array(array($this->instance, $method), $parameters);
190 190
 		}
191 191
 	}
192 192
 
Please login to merge, or discard this patch.
templates/payment-forms/elements/date.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 echo aui()->input(
13 13
     array(
14
-        'name'       => esc_attr( $id ),
15
-        'id'         => esc_attr( $id ) . uniqid( '_' ),
16
-        'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ),
17
-        'required'   => ! empty( $required ),
18
-        'label'      => empty( $label ) ? '' : wp_kses_post( $label ),
14
+        'name'       => esc_attr($id),
15
+        'id'         => esc_attr($id) . uniqid('_'),
16
+        'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder),
17
+        'required'   => !empty($required),
18
+        'label'      => empty($label) ? '' : wp_kses_post($label),
19 19
         'label_type' => 'vertical',
20
-        'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
20
+        'help_text'  => empty($description) ? '' : wp_kses_post($description),
21 21
         'type'       => 'datepicker',
22 22
     )
23 23
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/number.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 echo aui()->input(
13 13
     array(
14
-        'name'       => esc_attr( $id ),
15
-        'id'         => esc_attr( $id ) . uniqid( '_' ),
16
-        'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ),
17
-        'required'   => ! empty( $required ),
18
-        'label'      => empty( $label ) ? '' : wp_kses_post( $label ),
14
+        'name'       => esc_attr($id),
15
+        'id'         => esc_attr($id) . uniqid('_'),
16
+        'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder),
17
+        'required'   => !empty($required),
18
+        'label'      => empty($label) ? '' : wp_kses_post($label),
19 19
         'label_type' => 'vertical',
20
-        'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
20
+        'help_text'  => empty($description) ? '' : wp_kses_post($description),
21 21
         'type'       => 'number',
22 22
     )
23 23
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/alert.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-if ( empty( $text ) ) {
12
+if (empty($text)) {
13 13
     return;
14 14
 }
15 15
 
16 16
 echo aui()->alert(
17 17
     array(
18
-        'content'     => wp_kses_post( $text ),
19
-        'dismissible' => ! empty( $dismissible ),
20
-        'type'        => empty( $class ) ? 'info' : str_replace( 'alert-', '', $class ),
18
+        'content'     => wp_kses_post($text),
19
+        'dismissible' => !empty($dismissible),
20
+        'type'        => empty($class) ? 'info' : str_replace('alert-', '', $class),
21 21
     )
22 22
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/select.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 echo aui()->select(
13 13
     array(
14
-        'name'       => esc_attr( $id ),
15
-        'id'         => esc_attr( $id ) . uniqid( '_' ),
16
-        'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ),
17
-        'required'   => ! empty( $required ),
18
-        'label'      => empty( $label ) ? '' : wp_kses_post( $label ),
14
+        'name'       => esc_attr($id),
15
+        'id'         => esc_attr($id) . uniqid('_'),
16
+        'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder),
17
+        'required'   => !empty($required),
18
+        'label'      => empty($label) ? '' : wp_kses_post($label),
19 19
         'label_type' => 'vertical',
20
-        'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
21
-        'options'    => empty( $options ) ? array() : array_combine( $options, $options ),
20
+        'help_text'  => empty($description) ? '' : wp_kses_post($description),
21
+        'options'    => empty($options) ? array() : array_combine($options, $options),
22 22
     )
23 23
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/separator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,6 +7,6 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 ?>
12 12
 <hr class="featurette-divider" />
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
templates/payment-forms/elements/website.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 echo aui()->input(
13 13
     array(
14
-        'name'       => esc_attr( $id ),
15
-        'id'         => esc_attr( $id ) . uniqid( '_' ),
16
-        'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ),
17
-        'required'   => ! empty( $required ),
18
-        'label'      => empty( $label ) ? '' : wp_kses_post( $label ),
14
+        'name'       => esc_attr($id),
15
+        'id'         => esc_attr($id) . uniqid('_'),
16
+        'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder),
17
+        'required'   => !empty($required),
18
+        'label'      => empty($label) ? '' : wp_kses_post($label),
19 19
         'label_type' => 'vertical',
20
-        'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
20
+        'help_text'  => empty($description) ? '' : wp_kses_post($description),
21 21
         'type'       => 'url',
22 22
     )
23 23
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/email.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 echo aui()->input(
13 13
     array(
14
-        'name'       => esc_attr( $id ),
15
-        'id'         => esc_attr( $id ) . uniqid( '_' ),
16
-        'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ),
17
-        'required'   => ! empty( $required ),
18
-        'label'      => empty( $label ) ? '' : wp_kses_post( $label ),
14
+        'name'       => esc_attr($id),
15
+        'id'         => esc_attr($id) . uniqid('_'),
16
+        'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder),
17
+        'required'   => !empty($required),
18
+        'label'      => empty($label) ? '' : wp_kses_post($label),
19 19
         'label_type' => 'vertical',
20
-        'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
20
+        'help_text'  => empty($description) ? '' : wp_kses_post($description),
21 21
         'type'       => 'email',
22 22
     )
23 23
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/heading.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$tag  = isset( $element['level'] ) ? trim( $element['level'] ) : 'h3';
13
-$text = isset( $element['text'] ) ? trim( $element['text'] ) : '';
12
+$tag  = isset($element['level']) ? trim($element['level']) : 'h3';
13
+$text = isset($element['text']) ? trim($element['text']) : '';
14 14
 
15
-if ( ! empty( $text ) ) {
15
+if (!empty($text)) {
16 16
     echo "<$tag>$text</$tag>";
17 17
 }
Please login to merge, or discard this patch.