Passed
Push — master ( e12f40...18a46a )
by Christian
01:27
created
podlove.php 1 patch
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 		}
146 146
 
147 147
 		if ( isset($args['hide']) && $args['hide'] == 'true' ) {
148
-			$hide = TRUE;
148
+			$hide = true;
149 149
 		} else {
150
-			$hide = FALSE;
150
+			$hide = false;
151 151
 		}
152 152
 
153 153
 		// Render button
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		if ( isset($args[$key]) )
159 159
 			return $args[$key];
160 160
 
161
-		return FALSE;
161
+		return false;
162 162
 	}
163 163
 
164 164
 	/**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 * @param  string $attribute_value
167 167
 	 * @return string
168 168
 	 */
169
-	private static function get_attribute($attribute=NULL, $attribute_value=NULL) {
169
+	private static function get_attribute($attribute=null, $attribute_value=null) {
170 170
 		if ( isset($attribute_value) && ctype_alnum($attribute_value) && key_exists( $attribute_value, \PodloveSubscribeButton\Model\Button::$$attribute ) ) {
171 171
 			return $attribute_value;
172 172
 		} else {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * @param  string $width_attribute
180 180
 	 * @return string
181 181
 	 */
182
-	private static function interpret_width_attribute( $width_attribute = NULL ) {
182
+	private static function interpret_width_attribute( $width_attribute = null ) {
183 183
 		if ( $width_attribute == 'auto' )
184 184
 			return 'on';
185 185
 		if ( $width_attribute && $width_attribute !== 'auto' )
Please login to merge, or discard this patch.
model/base.php 1 patch
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		} elseif ( property_exists( $this, $name ) ) {
33 33
 			return $this->$name;
34 34
 		} else {
35
-			return NULL;
35
+			return null;
36 36
 		}
37 37
 	}
38 38
 	
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		if ( isset( $this->data[ $name ] ) ) {
41 41
 			return $this->data[ $name ];
42 42
 		} else {
43
-			return NULL;
43
+			return null;
44 44
 		}
45 45
 	}
46 46
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		$row = $wpdb->get_row( 'SELECT * FROM ' . static::table_name() . ' WHERE id = ' . (int) $id );
168 168
 		
169 169
 		if ( ! $row ) {
170
-			return NULL;
170
+			return null;
171 171
 		}
172 172
 		
173 173
 		foreach ( $row as $property => $value ) {
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		);
216 216
 		
217 217
 		if ( ! $row ) {
218
-			return NULL;
218
+			return null;
219 219
 		}
220 220
 		
221 221
 		foreach ( $row as $property => $value ) {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 		);
264 264
 		
265 265
 		if ( ! $row ) {
266
-			return NULL;
266
+			return null;
267 267
 		}
268 268
 		
269 269
 		foreach ( $row as $property => $value ) {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 			return;
434 434
 
435 435
 		foreach ( $defaults as $property => $value ) {
436
-			if ( $this->$property === NULL )
436
+			if ( $this->$property === null )
437 437
 				$this->$property = $value;
438 438
 		}
439 439
 
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 	private function property_name_to_sql_update_statement( $p ) {
469 469
 		global $wpdb;
470 470
 
471
-		if ( $this->$p !== NULL && $this->$p !== '' ) {
471
+		if ( $this->$p !== null && $this->$p !== '' ) {
472 472
 			return sprintf( "%s = '%s'", $p, ( is_array($this->$p) ? serialize($this->$p) : $this->$p ) );
473 473
 		} else {
474 474
 			return "$p = NULL";
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 	private function property_name_to_sql_value( $p ) {
479 479
 		global $wpdb;
480 480
 
481
-		if ( $this->$p !== NULL && $this->$p !== '' ) {
481
+		if ( $this->$p !== null && $this->$p !== '' ) {
482 482
 			return sprintf( "'%s'", $this->$p );
483 483
 		} else {
484 484
 			return 'NULL';
Please login to merge, or discard this patch.
model/button.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 			return $network_button;
55 55
 		}
56 56
 
57
-		return FALSE;
57
+		return false;
58 58
 	}
59 59
 
60 60
 	/**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @param  boolean $buttonid
82 82
 	 * @return string
83 83
 	 */
84
-	public function render( $size='big', $autowidth='on', $style='filled', $format='rectangle', $color='#599677', $hide = FALSE, $buttonid = FALSE, $language='en' ) {
84
+	public function render( $size='big', $autowidth='on', $style='filled', $format='rectangle', $color='#599677', $hide = false, $buttonid = false, $language='en' ) {
85 85
 		$button_styling = array_merge(
86 86
 				$this->get_button_styling($size, $autowidth, $style, $format, $color),
87 87
 				array(
Please login to merge, or discard this patch.
settings/buttons.php 1 patch
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
 
7 7
 	public static function page() {
8 8
 
9
-		$action = null !== filter_input(INPUT_GET, 'action') ? filter_input(INPUT_GET, 'action') : NULL;
9
+		$action = null !== filter_input(INPUT_GET, 'action') ? filter_input(INPUT_GET, 'action') : null;
10 10
 		$is_network = is_network_admin();
11 11
 
12 12
 		if ( $action == 'confirm_delete' && null !== filter_input(INPUT_GET, 'button') ) {
13
-			$button = ( $is_network === TRUE ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( (int) filter_input(INPUT_GET, 'button') ) : \PodloveSubscribeButton\Model\Button::find_by_id( (int) filter_input(INPUT_GET, 'button') ) );
13
+			$button = ( $is_network === true ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( (int) filter_input(INPUT_GET, 'button') ) : \PodloveSubscribeButton\Model\Button::find_by_id( (int) filter_input(INPUT_GET, 'button') ) );
14 14
 			?>
15 15
 			<div class="updated">
16 16
 				<p>
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 		$button->update_attributes( $post['podlove_button'] );
55 55
 
56 56
 		if ( isset($post['submit_and_stay']) ) {
57
-			self::redirect( 'edit', $button->id, array( 'network' => filter_input(INPUT_GET, 'network') ), ( filter_input(INPUT_GET, 'network') === '1' ? TRUE : FALSE ) );
57
+			self::redirect( 'edit', $button->id, array( 'network' => filter_input(INPUT_GET, 'network') ), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
58 58
 		} else {
59
-			self::redirect( 'index', $button->id, array(), ( filter_input(INPUT_GET, 'network') === '1' ? TRUE : FALSE ) );
59
+			self::redirect( 'index', $button->id, array(), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
60 60
 		}
61 61
 	}
62 62
 	/**
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
 		$button->update_attributes( $post['podlove_button'] );
72 72
 
73 73
 		if ( isset($post['submit_and_stay']) ) {
74
-			self::redirect( 'edit', $button->id, array( 'network' => filter_input(INPUT_GET, 'network') ), ( filter_input(INPUT_GET, 'network') === '1' ? TRUE : FALSE ) );
74
+			self::redirect( 'edit', $button->id, array( 'network' => filter_input(INPUT_GET, 'network') ), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
75 75
 		} else {
76
-			self::redirect( 'index', $button->id, array(), ( filter_input(INPUT_GET, 'network') === '1' ? TRUE : FALSE ) );
76
+			self::redirect( 'index', $button->id, array(), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
77 77
 		}
78 78
 	}
79 79
 
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 		$button = ( filter_input(INPUT_GET, 'network') === '1' ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input(INPUT_GET, 'button') ) : \PodloveSubscribeButton\Model\Button::find_by_id( filter_input(INPUT_GET, 'button') ) );
88 88
 		$button->delete();
89 89
 
90
-		self::redirect( 'index', NULL, array(), ( filter_input(INPUT_GET, 'network') === '1' ? TRUE : FALSE ) );
90
+		self::redirect( 'index', null, array(), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
91 91
 	}
92 92
 
93 93
 	/**
94 94
 	 * Helper method: redirect to a certain page.
95 95
 	 */
96
-	public static function redirect( $action, $button_id = NULL, $params = array(), $network = FALSE ) {
96
+	public static function redirect( $action, $button_id = null, $params = array(), $network = false ) {
97 97
 		$page    = ( $network ? '/network/settings' : 'options-general' ) . '.php?page=' . filter_input(INPUT_GET, 'page');
98 98
 		$show    = ( $button_id ) ? '&button=' . $button_id : '';
99 99
 		$action  = '&action=' . $action;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		if ( null === filter_input(INPUT_GET, 'button') )
108 108
 			return;
109 109
 
110
-		$action = ( null !== filter_input(INPUT_GET, 'action') ? filter_input(INPUT_GET, 'action') : NULL );
110
+		$action = ( null !== filter_input(INPUT_GET, 'action') ? filter_input(INPUT_GET, 'action') : null );
111 111
 
112 112
 		if ( $action === 'save' ) {
113 113
 			self::save();
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		// Adjust if is_network
218 218
 		$is_network = is_network_admin();
219 219
 		?>
220
-		<form method="post" action="<?php echo ( $is_network === TRUE ? '/wp-admin/network/settings' : 'options-general' ) ?>.php?page=podlove-subscribe-button&button=<?php echo $button->id; ?>&action=<?php echo $action; ?>&network=<?php echo $is_network; ?>">
220
+		<form method="post" action="<?php echo ( $is_network === true ? '/wp-admin/network/settings' : 'options-general' ) ?>.php?page=podlove-subscribe-button&button=<?php echo $button->id; ?>&action=<?php echo $action; ?>&network=<?php echo $is_network; ?>">
221 221
 			<input type="hidden" value="<?php echo $button->id; ?>" name="podlove_button[id]" />
222 222
 			<table class="form-table" border="0" cellspacing="0">
223 223
 					<tbody>
Please login to merge, or discard this patch.