Completed
Push — master ( bfc3b8...8abcaa )
by Mike
02:08
created
includes/class-admin-page.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @subpackage Evans
9 9
  * @author     Old Town Media
10 10
  */
11
-class AdminPage{
11
+class AdminPage {
12 12
 
13 13
 	/**
14 14
 	 * Hooks function.
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 	 *
18 18
 	 * @see admin_menu, wp_ajax actions
19 19
 	 */
20
-	public function hooks(){
20
+	public function hooks() {
21 21
 
22
-		add_action( 'admin_menu' , array( $this, 'add_menu_item' ) );
23
-		add_action( 'wp_ajax_handle_test_data', array( $this, 'handle_test_data_callback' ) );
24
-		add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ) );
22
+		add_action('admin_menu', array($this, 'add_menu_item'));
23
+		add_action('wp_ajax_handle_test_data', array($this, 'handle_test_data_callback'));
24
+		add_action('admin_enqueue_scripts', array($this, 'load_scripts'));
25 25
 
26 26
 	}
27 27
 
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 
36 36
 		add_submenu_page(
37 37
 			'tools.php',
38
-			__( 'Create Test Data', 'evans-mu' ),
39
-			__( 'Test Data', 'evans-mu' ),
38
+			__('Create Test Data', 'evans-mu'),
39
+			__('Test Data', 'evans-mu'),
40 40
 			'manage_options',
41 41
 			'create-test-data',
42
-			array( $this, 'admin_page' )
42
+			array($this, 'admin_page')
43 43
 		);
44 44
 
45 45
 	}
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
 	/**
49 49
 	 * Load our script in the admin section and serve in data.
50 50
 	 */
51
-	public function load_scripts(){
51
+	public function load_scripts() {
52 52
 
53
-		wp_enqueue_script( 'test-content-js', plugins_url( 'assets/admin.js' , dirname( __FILE__ ) ) );
53
+		wp_enqueue_script('test-content-js', plugins_url('assets/admin.js', dirname(__FILE__)));
54 54
 
55 55
 		$data = array(
56
-			'nonce'	=> wp_create_nonce( 'handle-test-data' )
56
+			'nonce'	=> wp_create_nonce('handle-test-data')
57 57
 		);
58 58
 
59
-		wp_localize_script( 'test-content-js', 'test_content', $data );
59
+		wp_localize_script('test-content-js', 'test_content', $data);
60 60
 
61 61
 	}
62 62
 
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public function handle_test_data_callback() {
70 70
 
71
-		$action		= $_REQUEST['todo'];
72
-		$nonce		= $_REQUEST['nonce'];
71
+		$action = $_REQUEST['todo'];
72
+		$nonce = $_REQUEST['nonce'];
73 73
 
74 74
 		// Verify that we have a proper logged in user and it's the right person
75
-		if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'handle-test-data' ) ){
75
+		if (empty($nonce) || !wp_verify_nonce($nonce, 'handle-test-data')) {
76 76
 			return;
77 77
 		}
78 78
 
79
-		if ( $action == 'delete' ){
79
+		if ($action == 'delete') {
80 80
 
81
-			$this->deletion_routing( $_REQUEST );
81
+			$this->deletion_routing($_REQUEST);
82 82
 
83
-		} elseif ( $action == 'create' ){
83
+		} elseif ($action == 'create') {
84 84
 
85
-			$this->creation_routing( $_REQUEST );
85
+			$this->creation_routing($_REQUEST);
86 86
 
87 87
 		}
88 88
 
@@ -95,17 +95,17 @@  discard block
 block discarded – undo
95 95
 	 * Choose which type of creation needs to be accomplished and route through
96 96
 	 * the correct class.
97 97
 	 */
98
-	private function creation_routing( $data ){
98
+	private function creation_routing($data) {
99 99
 
100
-		if ( $data['type'] == 'post' ){
100
+		if ($data['type'] == 'post') {
101 101
 
102 102
 			$create_content = new CreatePost;
103
-			$create_content->create_post_type_content( $data['slug'], true, 1 );
103
+			$create_content->create_post_type_content($data['slug'], true, 1);
104 104
 
105
-		} elseif( $data['type'] == 'term' ){
105
+		} elseif ($data['type'] == 'term') {
106 106
 
107 107
 			$create_content = new CreateTerm;
108
-			$create_content->create_terms( $data['slug'], true, 1 );
108
+			$create_content->create_terms($data['slug'], true, 1);
109 109
 
110 110
 		}
111 111
 
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
 	 * Choose which type of deletion needs to be accomplished and route through
117 117
 	 * the correct method of Delete.
118 118
 	 */
119
-	private function deletion_routing( $data ){
119
+	private function deletion_routing($data) {
120 120
 
121 121
 		$delete_content = new Delete;
122 122
 
123
-		if ( $data['type'] == 'post' ){
123
+		if ($data['type'] == 'post') {
124 124
 
125
-			$delete_content->delete_post( $data['slug'], true );
125
+			$delete_content->delete_post($data['slug'], true);
126 126
 
127 127
 		}
128 128
 
@@ -132,23 +132,23 @@  discard block
 block discarded – undo
132 132
 	/**
133 133
 	 * Print out our admin page to control test data.
134 134
 	 */
135
-	public function admin_page(){
135
+	public function admin_page() {
136 136
 
137 137
 		$html = "";
138 138
 
139 139
 		$html .= '<div class="wrap" id="options_editor">' . "\n";
140 140
 
141
-			$html .= '<h2>' . __( 'Create Test Data' , 'evans-mu' ) . '</h2>' . "\n";
141
+			$html .= '<h2>' . __('Create Test Data', 'evans-mu') . '</h2>' . "\n";
142 142
 
143 143
 			// Loop through all other cpts
144
-			$post_types = get_post_types( array( 'public' => true ), 'objects' );
144
+			$post_types = get_post_types(array('public' => true), 'objects');
145 145
 
146 146
 			$html .= "<table>";
147 147
 
148
-			foreach ( $post_types as $post_type ) {
148
+			foreach ($post_types as $post_type) {
149 149
 
150 150
 				// Skip Attachments
151
-				if ( $post_type->name == 'attachment' ){
151
+				if ($post_type->name == 'attachment') {
152 152
 					continue;
153 153
 				}
154 154
 
@@ -157,28 +157,28 @@  discard block
 block discarded – undo
157 157
 					$html .= "<h3>";
158 158
 
159 159
 						$html .= "<span style='width: 20%; display: inline-block;'>" . $post_type->labels->name . "</span>";
160
-						$html .= " <a href='javascript:void(0);' data-type='post' data-slug='".$post_type->name."' data-todo='create' class='button-primary handle-test-data' /><span class='dashicons dashicons-plus' style='margin-top: 6px; font-size: 1.2em'></span> Create Test Data</a>";
161
-						$html .= " <a href='javascript:void(0);' data-type='post' data-slug='".$post_type->name."' data-todo='delete' class='button-primary handle-test-data' /><span class='dashicons dashicons-trash' style='margin-top: 4px; font-size: 1.2em'></span> Delete Test Data</a>";
160
+						$html .= " <a href='javascript:void(0);' data-type='post' data-slug='" . $post_type->name . "' data-todo='create' class='button-primary handle-test-data' /><span class='dashicons dashicons-plus' style='margin-top: 6px; font-size: 1.2em'></span> Create Test Data</a>";
161
+						$html .= " <a href='javascript:void(0);' data-type='post' data-slug='" . $post_type->name . "' data-todo='delete' class='button-primary handle-test-data' /><span class='dashicons dashicons-trash' style='margin-top: 4px; font-size: 1.2em'></span> Delete Test Data</a>";
162 162
 
163 163
 					$html .= "</h3>";
164 164
 
165
-					$taxonomies = get_object_taxonomies( $post_type->name );
165
+					$taxonomies = get_object_taxonomies($post_type->name);
166 166
 
167
-						if ( !empty( $taxonomies ) ){
167
+						if (!empty($taxonomies)) {
168 168
 
169
-							foreach( $taxonomies as $tax ){
169
+							foreach ($taxonomies as $tax) {
170 170
 
171 171
 								$html .= "<h3>";
172 172
 
173
-								if ( $tax == 'post_format' ){
173
+								if ($tax == 'post_format') {
174 174
 									continue;
175 175
 								}
176 176
 
177
-								$taxonomy = get_taxonomy( $tax );
177
+								$taxonomy = get_taxonomy($tax);
178 178
 
179
-								$html .= "<span style='width: 20%; display: inline-block; font-size: .9em'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$taxonomy->labels->name."</span>";
179
+								$html .= "<span style='width: 20%; display: inline-block; font-size: .9em'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $taxonomy->labels->name . "</span>";
180 180
 
181
-								$html .= " <a href='javascript:void(0);' data-type='term' data-slug='".$tax."' data-todo='create' class='button-primary handle-test-data' /><span class='dashicons dashicons-category' style='margin-top: 4px; font-size: 1.2em'></span> Create ".$taxonomy->labels->name."</a>";
181
+								$html .= " <a href='javascript:void(0);' data-type='term' data-slug='" . $tax . "' data-todo='create' class='button-primary handle-test-data' /><span class='dashicons dashicons-category' style='margin-top: 4px; font-size: 1.2em'></span> Create " . $taxonomy->labels->name . "</a>";
182 182
 
183 183
 								$html .= "</h3>";
184 184
 
Please login to merge, or discard this patch.
includes/class-test-content.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -252,29 +252,29 @@  discard block
 block discarded – undo
252 252
 		}
253 253
 
254 254
 		// Download the file
255
-	    $tmp = \download_url( $url );
255
+		$tmp = \download_url( $url );
256 256
 
257
-	    preg_match( '/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches );
257
+		preg_match( '/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches );
258 258
 
259
-        $file_array['name'] = basename( $matches[0] );
260
-        $file_array['tmp_name'] = $tmp;
259
+		$file_array['name'] = basename( $matches[0] );
260
+		$file_array['tmp_name'] = $tmp;
261 261
 
262
-	    // Check for download errors
263
-	    if ( is_wp_error( $tmp ) ) {
264
-	        unlink( $file_array[ 'tmp_name' ] );
265
-	        return $tmp->get_error_message();
266
-	    }
262
+		// Check for download errors
263
+		if ( is_wp_error( $tmp ) ) {
264
+			unlink( $file_array[ 'tmp_name' ] );
265
+			return $tmp->get_error_message();
266
+		}
267 267
 
268 268
 		// Pull the image into the media library
269
-	    $image_id = media_handle_sideload( $file_array, $post_id );
269
+		$image_id = media_handle_sideload( $file_array, $post_id );
270 270
 
271
-	    // Check for handle sideload errors.
272
-	    if ( is_wp_error( $image_id ) ) {
273
-	        unlink( $file_array['tmp_name'] );
274
-	        return $image_id->get_error_message();
275
-	    }
271
+		// Check for handle sideload errors.
272
+		if ( is_wp_error( $image_id ) ) {
273
+			unlink( $file_array['tmp_name'] );
274
+			return $image_id->get_error_message();
275
+		}
276 276
 
277
-	    return $image_id;
277
+		return $image_id;
278 278
 
279 279
 	}
280 280
 
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
 
298 298
 		// If our cURL failed
299 299
 		if ( $curl_response === false ) {
300
-		    $info = curl_getinfo( $curl );
301
-		    curl_close( $curl );
302
-		    die( 'error occured during curl exec. Additional info: ' . var_export( $info ) );
300
+			$info = curl_getinfo( $curl );
301
+			curl_close( $curl );
302
+			die( 'error occured during curl exec. Additional info: ' . var_export( $info ) );
303 303
 		}
304 304
 
305 305
 		curl_close( $curl );
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * @subpackage Evans
15 15
  * @author     Old Town Media
16 16
  */
17
-class TestContent{
17
+class TestContent {
18 18
 
19 19
 	/**
20 20
 	 * Title function.
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @param int $num_words Number of words to return.
27 27
 	 * @return string Random title string.
28 28
 	 */
29
-	public static function title( $num_words = '' ){
29
+	public static function title($num_words = '') {
30 30
 
31 31
 		$title = '';
32 32
 
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
 		);
68 68
 
69 69
 		// If we didn't choose a count, make one
70
-		if ( empty( $num_words ) ){
71
-			$num_words = rand( 2, 10 );
70
+		if (empty($num_words)) {
71
+			$num_words = rand(2, 10);
72 72
 		}
73 73
 
74 74
 		// Pull random words
75
-		for( $i = 1; $i <= $num_words; $i++ ){
76
-			$title .= $random_words[ rand( 0, 31 ) ] . " ";
75
+		for ($i = 1; $i <= $num_words; $i++) {
76
+			$title .= $random_words[rand(0, 31)] . " ";
77 77
 		}
78 78
 
79
-		return substr( $title, 0, -1 );
79
+		return substr($title, 0, -1);
80 80
 
81 81
 	}
82 82
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 *
90 90
 	 * @return string Paragraph(s) of text.
91 91
 	 */
92
-	public static function paragraphs(){
92
+	public static function paragraphs() {
93 93
 
94 94
 		$content = '';
95 95
 
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 			'Sed porttitor augue vitae ante posuere sodales iaculis nec neque. Etiam dapibus nulla id vulputate tempus. Quisque tempus nisi dui, a commodo nulla sodales ut. Nulla nec odio tempus, sodales diam quis, feugiat odio. Nulla tincidunt tincidunt turpis, eget cursus felis tempor lacinia. Aenean molestie libero ut erat luctus aliquam. Sed vel enim quis nisl lacinia posuere. Ut fringilla ligula ligula, nec rhoncus mi suscipit id. Praesent volutpat blandit felis, et suscipit elit vulputate sit amet. Morbi sit amet justo quis sem rutrum euismod. Pellentesque at dictum sem, sed condimentum ex. Vivamus massa nisi, convallis in semper sit amet, venenatis convallis lectus. Nunc tristique, ex ac rutrum vehicula, arcu ex efficitur justo, sed euismod ligula nulla ut purus.',
186 186
 		);
187 187
 
188
-		for( $i = 1; $i < 6; $i++ ){
189
-			$content .= $random_content_types[rand( 0, 9 )];
188
+		for ($i = 1; $i < 6; $i++) {
189
+			$content .= $random_content_types[rand(0, 9)];
190 190
 		}
191 191
 
192 192
 		return $content;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 *
202 202
 	 * @return string Plain text paragraphs.
203 203
 	 */
204
-	public static function plain_text(){
204
+	public static function plain_text() {
205 205
 
206 206
 		$paragraphs = array(
207 207
 			'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean tincidunt luctus eros, a tincidunt massa aliquet sit amet. Sed faucibus, eros non lacinia porttitor, risus odio efficitur sapien, id porta urna massa ac est. Cras efficitur lacinia magna eget tempus. Fusce ex felis, finibus consectetur mi at, finibus rhoncus augue. In ut tortor lacinia, rutrum mauris vel, maximus tortor. Praesent ac arcu nec eros pharetra tristique. Morbi congue leo sed ipsum fermentum vulputate. Ut nulla eros, porta varius pulvinar eget, bibendum quis dolor. Morbi sed diam eu dui semper ornare nec quis nisl.',
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			'Fusce semper erat tortor, at pulvinar risus luctus suscipit. Phasellus quis enim nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas semper dapibus odio, nec pellentesque sem laoreet sit amet. Maecenas ut enim tellus. Fusce malesuada mattis sem, porta interdum ex fermentum quis. Ut eget quam mi. In molestie volutpat feugiat. Nulla vel viverra nunc. Integer lobortis nisl vitae placerat egestas. Curabitur tristique nulla at libero blandit, a eleifend augue tempus.',
217 217
 		);
218 218
 
219
-		return $paragraphs[ rand( 0, 9 ) ];
219
+		return $paragraphs[rand(0, 9)];
220 220
 
221 221
 	}
222 222
 
@@ -232,45 +232,45 @@  discard block
 block discarded – undo
232 232
 	 * @param int $post_id Post ID.
233 233
 	 * @return mixed Attachment ID or WP Error.
234 234
 	 */
235
-	public static function image( $post_id ){
235
+	public static function image($post_id) {
236 236
 		$file_array = array();
237 237
 
238 238
 		// Get the image from the API
239 239
 		$url = self::get_image_link();
240 240
 
241 241
 		// If the returned string is empty or it's not a string, try again.
242
-		if ( empty( $url ) || !is_string( $url ) ){
242
+		if (empty($url) || !is_string($url)) {
243 243
 
244 244
 			// Try again
245 245
 			$url = self::get_image_link();
246 246
 
247 247
 			// If it fails again, just give up
248
-			if ( empty( $url ) || !is_string( $url ) ){
248
+			if (empty($url) || !is_string($url)) {
249 249
 				return;
250 250
 			}
251 251
 
252 252
 		}
253 253
 
254 254
 		// Download the file
255
-	    $tmp = \download_url( $url );
255
+	    $tmp = \download_url($url);
256 256
 
257
-	    preg_match( '/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches );
257
+	    preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches);
258 258
 
259
-        $file_array['name'] = basename( $matches[0] );
259
+        $file_array['name'] = basename($matches[0]);
260 260
         $file_array['tmp_name'] = $tmp;
261 261
 
262 262
 	    // Check for download errors
263
-	    if ( is_wp_error( $tmp ) ) {
264
-	        unlink( $file_array[ 'tmp_name' ] );
263
+	    if (is_wp_error($tmp)) {
264
+	        unlink($file_array['tmp_name']);
265 265
 	        return $tmp->get_error_message();
266 266
 	    }
267 267
 
268 268
 		// Pull the image into the media library
269
-	    $image_id = media_handle_sideload( $file_array, $post_id );
269
+	    $image_id = media_handle_sideload($file_array, $post_id);
270 270
 
271 271
 	    // Check for handle sideload errors.
272
-	    if ( is_wp_error( $image_id ) ) {
273
-	        unlink( $file_array['tmp_name'] );
272
+	    if (is_wp_error($image_id)) {
273
+	        unlink($file_array['tmp_name']);
274 274
 	        return $image_id->get_error_message();
275 275
 	    }
276 276
 
@@ -286,31 +286,31 @@  discard block
 block discarded – undo
286 286
 	 *
287 287
 	 * @return string Image URL.
288 288
 	 */
289
-	private static function get_image_link(){
289
+	private static function get_image_link() {
290 290
 
291 291
 		// cURL an image API for a completely random photo
292
-		$curl = curl_init( "http://www.splashbase.co/api/v1/images/random?images_only=true" );
292
+		$curl = curl_init("http://www.splashbase.co/api/v1/images/random?images_only=true");
293 293
 
294
-		curl_setopt( $curl, CURLOPT_RETURNTRANSFER, TRUE );
294
+		curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
295 295
 
296
-		$curl_response = curl_exec( $curl );
296
+		$curl_response = curl_exec($curl);
297 297
 
298 298
 		// If our cURL failed
299
-		if ( $curl_response === false ) {
300
-		    $info = curl_getinfo( $curl );
301
-		    curl_close( $curl );
302
-		    die( 'error occured during curl exec. Additional info: ' . var_export( $info ) );
299
+		if ($curl_response === false) {
300
+		    $info = curl_getinfo($curl);
301
+		    curl_close($curl);
302
+		    die('error occured during curl exec. Additional info: ' . var_export($info));
303 303
 		}
304 304
 
305
-		curl_close( $curl );
305
+		curl_close($curl);
306 306
 
307 307
 		// Decode the data
308
-		$response = json_decode( $curl_response, true );
308
+		$response = json_decode($curl_response, true);
309 309
 
310 310
 		// Check to make sure that the return contains a valid image extensions
311 311
 		preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $response['url'], $matches);
312 312
 
313
-		if ( !empty( $matches ) ){
313
+		if (!empty($matches)) {
314 314
 			return $response['url'];
315 315
 		}
316 316
 
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
 	 * @param string $format PHP Date format.
326 326
 	 * @return mixed Date in the format requested.
327 327
 	 */
328
-	public static function date( $format ){
328
+	public static function date($format) {
329 329
 
330
-		$num_days = rand( 1, 60 );
331
-		return date( $format, strtotime( " +$num_days days" ) );
330
+		$num_days = rand(1, 60);
331
+		return date($format, strtotime(" +$num_days days"));
332 332
 
333 333
 	}
334 334
 
@@ -340,19 +340,19 @@  discard block
 block discarded – undo
340 340
 	 *
341 341
 	 * @return string Time string
342 342
 	 */
343
-	public static function time(){
343
+	public static function time() {
344 344
 
345 345
 		$times = array(
346 346
 			'8:00 am',
347 347
 			'5:00PM',
348 348
 			'13:00',
349 349
 			'2015',
350
-			date( 'G:i', strtotime( " +".rand( 4, 24 )." hours" ) ),
351
-			date( 'g:i', strtotime( " +".rand( 4, 24 )." hours" ) ),
352
-			date( 'G:i A', strtotime( " +".rand( 4, 24 )." hours" ) )
350
+			date('G:i', strtotime(" +" . rand(4, 24) . " hours")),
351
+			date('g:i', strtotime(" +" . rand(4, 24) . " hours")),
352
+			date('G:i A', strtotime(" +" . rand(4, 24) . " hours"))
353 353
 		);
354 354
 
355
-		return $times[ rand( 0, 6 ) ];
355
+		return $times[rand(0, 6)];
356 356
 
357 357
 	}
358 358
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	 *
365 365
 	 * @return string Timezone
366 366
 	 */
367
-	public static function timezone(){
367
+	public static function timezone() {
368 368
 
369 369
 		$timezones = array(
370 370
 			'America/Denver',
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 			'UTC'
383 383
 		);
384 384
 
385
-		return $timezones[ rand( 0, 12 ) ];
385
+		return $timezones[rand(0, 12)];
386 386
 
387 387
 	}
388 388
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 *
396 396
 	 * @return string Phone #.
397 397
 	 */
398
-	public static function phone(){
398
+	public static function phone() {
399 399
 
400 400
 		$phone_numbers = array(
401 401
 			'7203893101',
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			'+43 780 0047112'
412 412
 		);
413 413
 
414
-		return $phone_numbers[ rand( 0, 10 ) ];
414
+		return $phone_numbers[rand(0, 10)];
415 415
 
416 416
 	}
417 417
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 	 *
424 424
 	 * @return string Email address.
425 425
 	 */
426
-	public static function email(){
426
+	public static function email() {
427 427
 
428 428
 		$email_addresses = array(
429 429
 			'[email protected]',
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 			'[email protected]'
437 437
 		);
438 438
 
439
-		return $email_addresses[ rand( 0, 7 ) ];
439
+		return $email_addresses[rand(0, 7)];
440 440
 
441 441
 	}
442 442
 
@@ -450,12 +450,12 @@  discard block
 block discarded – undo
450 450
 	 *
451 451
 	 * @return string URL.
452 452
 	 */
453
-	public static function link(){
453
+	public static function link() {
454 454
 
455 455
 		$links = array(
456 456
 			'http://google.com',
457 457
 			'https://www.twitter.com',
458
-			site_url( '/?iam=anextravariable' ),
458
+			site_url('/?iam=anextravariable'),
459 459
 			'github.com',
460 460
 			'http://filebase.com',
461 461
 			'www.oldtownmediainc.com',
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 			'https://www.eff.org'
464 464
 		);
465 465
 
466
-		return $links[ rand( 0, 7 ) ];
466
+		return $links[rand(0, 7)];
467 467
 
468 468
 	}
469 469
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 	 *
475 475
 	 * @return string URL.
476 476
 	 */
477
-	public static function oembed(){
477
+	public static function oembed() {
478 478
 
479 479
 		$links = array(
480 480
 			'https://www.youtube.com/watch?v=A85-YQsm6pY',
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 			'https://www.instagram.com/p/-eyLo0RMfX',
486 486
 		);
487 487
 
488
-		return $links[ rand( 0, 5 ) ];
488
+		return $links[rand(0, 5)];
489 489
 
490 490
 	}
491 491
 
@@ -499,10 +499,10 @@  discard block
 block discarded – undo
499 499
 	 * @param	string $type Video service to get link from
500 500
 	 * @return	string URL.
501 501
 	 */
502
-	public static function video( $type ){
502
+	public static function video($type) {
503 503
 
504 504
 		// Switch through our video types. Expecting to add more in the future
505
-		switch( $type ){
505
+		switch ($type) {
506 506
 
507 507
 			// YouTube videos
508 508
 			case 'youtube' :
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 
544 544
 		}
545 545
 
546
-		return $links[ rand( 0, 8 ) ];
546
+		return $links[rand(0, 8)];
547 547
 
548 548
 	}
549 549
 
Please login to merge, or discard this patch.