Completed
Push — instant-search-master ( 404687...5ddf14 )
by
unknown
10:34 queued 04:11
created

Jetpack_Cxn_Test_Base::failing_test()   B

Complexity

Conditions 6
Paths 10

Size

Total Lines 31

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 6
nc 10
nop 8
dl 0
loc 31
rs 8.8017
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
/**
3
 * Base class for Jetpack's debugging tests.
4
 *
5
 * @package Jetpack.
6
 */
7
8
use Automattic\Jetpack\Status;
9
10
/**
11
 * Jetpack Connection Testing
12
 *
13
 * Framework for various "unit tests" against the Jetpack connection.
14
 *
15
 * Individual tests should be added to the class-jetpack-cxn-tests.php file.
16
 *
17
 * @author Brandon Kraft
18
 * @package Jetpack
19
 */
20
21
/**
22
 * "Unit Tests" for the Jetpack connection.
23
 *
24
 * @since 7.1.0
25
 */
26
class Jetpack_Cxn_Test_Base {
27
28
	/**
29
	 * Tests to run on the Jetpack connection.
30
	 *
31
	 * @var array $tests
32
	 */
33
	protected $tests = array();
34
35
	/**
36
	 * Results of the Jetpack connection tests.
37
	 *
38
	 * @var array $results
39
	 */
40
	protected $results = array();
41
42
	/**
43
	 * Status of the testing suite.
44
	 *
45
	 * Used internally to determine if a test should be skipped since the tests are already failing. Assume passing.
46
	 *
47
	 * @var bool $pass
48
	 */
49
	protected $pass = true;
50
51
	/**
52
	 * Jetpack_Cxn_Test constructor.
53
	 */
54
	public function __construct() {
55
		$this->tests   = array();
56
		$this->results = array();
57
	}
58
59
	/**
60
	 * Adds a new test to the Jetpack Connection Testing suite.
61
	 *
62
	 * @since 7.1.0
63
	 * @since 7.3.0 Adds name parameter and returns WP_Error on failure.
64
	 *
65
	 * @param callable $callable Test to add to queue.
66
	 * @param string   $name Unique name for the test.
67
	 * @param string   $type   Optional. Core Site Health type: 'direct' if test can be run during initial load or 'async' if test should run async.
68
	 * @param array    $groups Optional. Testing groups to add test to.
69
	 *
70
	 * @return mixed True if successfully added. WP_Error on failure.
71
	 */
72
	public function add_test( $callable, $name, $type = 'direct', $groups = array( 'default' ) ) {
73
		if ( is_array( $name ) ) {
74
			// Pre-7.3.0 method passed the $groups parameter here.
75
			return new WP_Error( __( 'add_test arguments changed in 7.3.0. Please reference inline documentation.', 'jetpack' ) );
0 ignored issues
show
Unused Code introduced by
The call to WP_Error::__construct() has too many arguments starting with __('add_test arguments c...mentation.', 'jetpack').

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
76
		}
77
		if ( array_key_exists( $name, $this->tests ) ) {
78
			return new WP_Error( __( 'Test names must be unique.', 'jetpack' ) );
0 ignored issues
show
Unused Code introduced by
The call to WP_Error::__construct() has too many arguments starting with __('Test names must be unique.', 'jetpack').

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
79
		}
80
		if ( ! is_callable( $callable ) ) {
81
			return new WP_Error( __( 'Tests must be valid PHP callables.', 'jetpack' ) );
0 ignored issues
show
Unused Code introduced by
The call to WP_Error::__construct() has too many arguments starting with __('Tests must be valid ...callables.', 'jetpack').

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
82
		}
83
84
		$this->tests[ $name ] = array(
85
			'name'  => $name,
86
			'test'  => $callable,
87
			'group' => $groups,
88
			'type'  => $type,
89
		);
90
		return true;
91
	}
92
93
	/**
94
	 * Lists all tests to run.
95
	 *
96
	 * @since 7.3.0
97
	 *
98
	 * @param string $type Optional. Core Site Health type: 'direct' or 'async'. All by default.
99
	 * @param string $group Optional. A specific testing group. All by default.
100
	 *
101
	 * @return array $tests Array of tests with test information.
102
	 */
103
	public function list_tests( $type = 'all', $group = 'all' ) {
104
		if ( ! ( 'all' === $type || 'direct' === $type || 'async' === $type ) ) {
105
			_doing_it_wrong( 'Jetpack_Cxn_Test_Base->list_tests', 'Type must be all, direct, or async', '7.3.0' );
106
		}
107
108
		$tests = array();
109
		foreach ( $this->tests as $name => $value ) {
110
			// Get all valid tests by group staged.
111
			if ( 'all' === $group || $group === $value['group'] ) {
112
				$tests[ $name ] = $value;
113
			}
114
115
			// Next filter out any that do not match the type.
116
			if ( 'all' !== $type && $type !== $value['type'] ) {
117
				unset( $tests[ $name ] );
118
			}
119
		}
120
121
		return $tests;
122
	}
123
124
	/**
125
	 * Run a specific test.
126
	 *
127
	 * @since 7.3.0
128
	 *
129
	 * @param string $name Name of test.
130
	 *
131
	 * @return mixed $result Test result array or WP_Error if invalid name. {
132
	 * @type string $name Test name
133
	 * @type mixed  $pass True if passed, false if failed, 'skipped' if skipped.
134
	 * @type string $message Human-readable test result message.
135
	 * @type string $resolution Human-readable resolution steps.
136
	 * }
137
	 */
138
	public function run_test( $name ) {
139
		if ( array_key_exists( $name, $this->tests ) ) {
140
			return call_user_func( $this->tests[ $name ]['test'] );
141
		}
142
		return new WP_Error( __( 'There is no test by that name: ', 'jetpack' ) . $name );
0 ignored issues
show
Unused Code introduced by
The call to WP_Error::__construct() has too many arguments starting with __('There is no test by ...: ', 'jetpack') . $name.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
143
	}
144
145
	/**
146
	 * Runs the Jetpack connection suite.
147
	 */
148
	public function run_tests() {
149
		foreach ( $this->tests as $test ) {
150
			$result          = call_user_func( $test['test'] );
151
			$result['group'] = $test['group'];
152
			$result['type']  = $test['type'];
153
			$this->results[] = $result;
154
			if ( false === $result['pass'] ) {
155
				$this->pass = false;
156
			}
157
		}
158
	}
159
160
	/**
161
	 * Returns the full results array.
162
	 *
163
	 * @since 7.1.0
164
	 * @since 7.3.0 Add 'type'
165
	 *
166
	 * @param string $type  Test type, async or direct.
167
	 * @param string $group Testing group whose results we want. Defaults to all tests.
168
	 * @return array Array of test results.
169
	 */
170
	public function raw_results( $type = 'all', $group = 'all' ) {
171
		if ( ! $this->results ) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $this->results of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
172
			$this->run_tests();
173
		}
174
175
		$results = $this->results;
176
177
		if ( 'all' !== $group ) {
178
			foreach ( $results as $test => $result ) {
179
				if ( ! in_array( $group, $result['group'], true ) ) {
180
					unset( $results[ $test ] );
181
				}
182
			}
183
		}
184
185
		if ( 'all' !== $type ) {
186
			foreach ( $results as $test => $result ) {
187
				if ( $type !== $result['type'] ) {
188
					unset( $results[ $test ] );
189
				}
190
			}
191
		}
192
193
		return $results;
194
	}
195
196
	/**
197
	 * Returns the status of the connection suite.
198
	 *
199
	 * @since 7.1.0
200
	 * @since 7.3.0 Add 'type'
201
	 *
202
	 * @param string $type  Test type, async or direct. Optional, direct all tests.
203
	 * @param string $group Testing group to check status of. Optional, default all tests.
204
	 *
205
	 * @return true|array True if all tests pass. Array of failed tests.
206
	 */
207
	public function pass( $type = 'all', $group = 'all' ) {
208
		$results = $this->raw_results( $type, $group );
209
210
		foreach ( $results as $result ) {
211
			// 'pass' could be true, false, or 'skipped'. We only want false.
212
			if ( isset( $result['pass'] ) && false === $result['pass'] ) {
213
				return false;
214
			}
215
		}
216
217
		return true;
218
219
	}
220
221
	/**
222
	 * Return array of failed test messages.
223
	 *
224
	 * @since 7.1.0
225
	 * @since 7.3.0 Add 'type'
226
	 *
227
	 * @param string $type  Test type, direct or async.
228
	 * @param string $group Testing group whose failures we want. Defaults to "all".
229
	 *
230
	 * @return false|array False if no failed tests. Otherwise, array of failed tests.
231
	 */
232
	public function list_fails( $type = 'all', $group = 'all' ) {
233
		$results = $this->raw_results( $type, $group );
234
235
		foreach ( $results as $test => $result ) {
236
			// We do not want tests that passed or ones that are misconfigured (no pass status or no failure message).
237
			if ( ! isset( $result['pass'] ) || false !== $result['pass'] || ! isset( $result['message'] ) ) {
238
				unset( $results[ $test ] );
239
			}
240
		}
241
242
		return $results;
243
	}
244
245
	/**
246
	 * Helper function to return consistent responses for a passing test.
247
	 *
248
	 * @param string      $name Test name.
249
	 * @param string|bool $message Plain text message to show when test passed.
250
	 * @param string|bool $label Label to be used on Site Health card.
251
	 * @param string|bool $description HTML description to be used in Site Health card.
252
	 *
253
	 * @return array Test results.
254
	 */
255
	public static function passing_test( $name = 'Unnamed', $message = false, $label = false, $description = false ) {
256
		if ( ! $message ) {
257
			$message = __( 'Test Passed!', 'jetpack' );
258
		}
259
		return array(
260
			'name'        => $name,
261
			'pass'        => true,
262
			'message'     => $message,
263
			'description' => $description,
264
			'resolution'  => false,
265
			'severity'    => false,
266
			'label'       => $label,
267
		);
268
	}
269
270
	/**
271
	 * Helper function to return consistent responses for a skipped test.
272
	 *
273
	 * @param string $name Test name.
274
	 * @param string $message Reason for skipping the test. Optional.
0 ignored issues
show
Documentation introduced by
Should the type for parameter $message not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
275
	 *
276
	 * @return array Test results.
277
	 */
278
	public static function skipped_test( $name = 'Unnamed', $message = false ) {
279
		return array(
280
			'name'       => $name,
281
			'pass'       => 'skipped',
282
			'message'    => $message,
283
			'resolution' => false,
284
			'severity'   => false,
285
		);
286
	}
287
288
	/**
289
	 * Helper function to return consistent responses for a failing test.
290
	 *
291
	 * @since 7.1.0
292
	 * @since 7.3.0 Added $action for resolution action link, $severity for issue severity.
293
	 *
294
	 * @param string      $name Test name.
295
	 * @param string      $message Message detailing the failure.
296
	 * @param string      $resolution Optional. Steps to resolve.
0 ignored issues
show
Documentation introduced by
Should the type for parameter $resolution not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
297
	 * @param string      $action Optional. URL to direct users to self-resolve.
0 ignored issues
show
Documentation introduced by
Should the type for parameter $action not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
298
	 * @param string      $severity Optional. "critical" or "recommended" for failure stats. "good" for passing.
299
	 * @param string      $label Optional. The label to use instead of the test name.
0 ignored issues
show
Documentation introduced by
Should the type for parameter $label not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
300
	 * @param string|bool $action_label Optional. The label for the action url instead of default 'Resolve'.
301
	 * @param string|bool $description Optional. An HTML description to override resolution.
302
	 *
303
	 * @return array Test results.
304
	 */
305
	public static function failing_test( $name, $message, $resolution = false, $action = false, $severity = 'critical', $label = false, $action_label = false, $description = false ) {
306
		if ( ! $action_label ) {
307
			/* translators: Resolve is used as a verb, a command that when invoked will lead to a problem's solution. */
308
			$action_label = __( 'Resolve', 'jetpack' );
309
		}
310
		// Provide standard resolutions steps, but allow pass-through of non-standard ones.
311
		switch ( $resolution ) {
312
			case 'cycle_connection':
313
				$resolution = __( 'Please disconnect and reconnect Jetpack.', 'jetpack' ); // @todo: Link.
314
				break;
315
			case 'outbound_requests':
316
				$resolution = __( 'Please ask your hosting provider to confirm your server can make outbound requests to jetpack.com.', 'jetpack' );
317
				break;
318
			case 'support':
319
			case false:
0 ignored issues
show
Bug introduced by
It seems like you are loosely comparing $resolution of type false|string against false; this is ambiguous if the string can be empty. Consider using a strict comparison === instead.
Loading history...
320
				$resolution = __( 'Please contact Jetpack support.', 'jetpack' ); // @todo: Link to support.
321
				break;
322
		}
323
324
		return array(
325
			'name'         => $name,
326
			'pass'         => false,
327
			'message'      => $message,
328
			'resolution'   => $resolution,
329
			'action'       => $action,
330
			'severity'     => $severity,
331
			'label'        => $label,
332
			'action_label' => $action_label,
333
			'description'  => $description,
334
		);
335
	}
336
337
	/**
338
	 * Provide WP_CLI friendly testing results.
339
	 *
340
	 * @since 7.1.0
341
	 * @since 7.3.0 Add 'type'
342
	 *
343
	 * @param string $type  Test type, direct or async.
344
	 * @param string $group Testing group whose results we are outputting. Default all tests.
345
	 */
346
	public function output_results_for_cli( $type = 'all', $group = 'all' ) {
347
		if ( defined( 'WP_CLI' ) && WP_CLI ) {
348
			if ( ( new Status() )->is_development_mode() ) {
349
				WP_CLI::line( __( 'Jetpack is in Development Mode:', 'jetpack' ) );
350
				WP_CLI::line( Jetpack::development_mode_trigger_text() );
351
			}
352
			WP_CLI::line( __( 'TEST RESULTS:', 'jetpack' ) );
353
			foreach ( $this->raw_results( $group ) as $test ) {
354
				if ( true === $test['pass'] ) {
355
					WP_CLI::log( WP_CLI::colorize( '%gPassed:%n  ' . $test['name'] ) );
356
				} elseif ( 'skipped' === $test['pass'] ) {
357
					WP_CLI::log( WP_CLI::colorize( '%ySkipped:%n ' . $test['name'] ) );
358
					if ( $test['message'] ) {
359
						WP_CLI::log( '         ' . $test['message'] ); // Number of spaces to "tab indent" the reason.
360
					}
361
				} else { // Failed.
362
					WP_CLI::log( WP_CLI::colorize( '%rFailed:%n  ' . $test['name'] ) );
363
					WP_CLI::log( '         ' . $test['message'] ); // Number of spaces to "tab indent" the reason.
364
				}
365
			}
366
		}
367
	}
368
369
	/**
370
	 * Output results of failures in format expected by Core's Site Health tool for async tests.
371
	 *
372
	 * Specifically not asking for a testing group since we're opinionated that Site Heath should see all.
373
	 *
374
	 * @since 7.3.0
375
	 *
376
	 * @return array Array of test results
377
	 */
378
	public function output_results_for_core_async_site_health() {
379
		$result = array(
380
			'label'       => __( 'Jetpack passed all async tests.', 'jetpack' ),
381
			'status'      => 'good',
382
			'badge'       => array(
383
				'label' => __( 'Jetpack', 'jetpack' ),
384
				'color' => 'green',
385
			),
386
			'description' => sprintf(
387
				'<p>%s</p>',
388
				__( "Jetpack's async local testing suite passed all tests!", 'jetpack' )
389
			),
390
			'actions'     => '',
391
			'test'        => 'jetpack_debugger_local_testing_suite_core',
392
		);
393
394
		if ( $this->pass() ) {
395
			return $result;
396
		}
397
398
		$fails = $this->list_fails( 'async' );
399
		$error = false;
400
		foreach ( $fails as $fail ) {
0 ignored issues
show
Bug introduced by
The expression $fails of type false|array is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
401
			if ( ! $error ) {
402
				$error                 = true;
403
				$result['label']       = $fail['message'];
404
				$result['status']      = $fail['severity'];
405
				$result['description'] = sprintf(
406
					'<p>%s</p>',
407
					$fail['resolution']
408
				);
409 View Code Duplication
				if ( ! empty( $fail['action'] ) ) {
410
					$result['actions'] = sprintf(
411
						'<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
412
						esc_url( $fail['action'] ),
413
						__( 'Resolve', 'jetpack' ),
414
						/* translators: accessibility text */
415
						__( '(opens in a new tab)', 'jetpack' )
416
					);
417
				}
418
			} else {
419
				$result['description'] .= sprintf(
420
					'<p>%s</p>',
421
					__( 'There was another problem:', 'jetpack' )
422
				) . ' ' . $fail['message'] . ': ' . $fail['resolution'];
423
				if ( 'critical' === $fail['severity'] ) { // In case the initial failure is only "recommended".
424
					$result['status'] = 'critical';
425
				}
426
			}
427
		}
428
429
		return $result;
430
431
	}
432
433
	/**
434
	 * Provide single WP Error instance of all failures.
435
	 *
436
	 * @since 7.1.0
437
	 * @since 7.3.0 Add 'type'
438
	 *
439
	 * @param string $type  Test type, direct or async.
440
	 * @param string $group Testing group whose failures we want converted. Default all tests.
441
	 *
442
	 * @return WP_Error|false WP_Error with all failed tests or false if there were no failures.
443
	 */
444
	public function output_fails_as_wp_error( $type = 'all', $group = 'all' ) {
445
		if ( $this->pass( $group ) ) {
446
			return false;
447
		}
448
		$fails = $this->list_fails( $type, $group );
449
		$error = false;
450
451
		foreach ( $fails as $result ) {
0 ignored issues
show
Bug introduced by
The expression $fails of type false|array is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
452
			$code    = 'failed_' . $result['name'];
453
			$message = $result['message'];
454
			$data    = array(
455
				'resolution' => $result['resolution'],
456
			);
457
			if ( ! $error ) {
458
				$error = new WP_Error( $code, $message, $data );
0 ignored issues
show
Unused Code introduced by
The call to WP_Error::__construct() has too many arguments starting with $code.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
459
			} else {
460
				$error->add( $code, $message, $data );
0 ignored issues
show
Bug introduced by
The method add() does not seem to exist on object<WP_Error>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
461
			}
462
		}
463
464
		return $error;
465
	}
466
467
	/**
468
	 * Encrypt data for sending to WordPress.com.
469
	 *
470
	 * @todo When PHP minimum is 5.3+, add cipher detection to use an agreed better cipher than RC4. RC4 should be the last resort.
471
	 *
472
	 * @param string $data Data to encrypt with the WP.com Public Key.
473
	 *
474
	 * @return false|array False if functionality not available. Array of encrypted data, encryption key.
475
	 */
476
	public function encrypt_string_for_wpcom( $data ) {
477
		$return = false;
478
		if ( ! function_exists( 'openssl_get_publickey' ) || ! function_exists( 'openssl_seal' ) ) {
479
			return $return;
480
		}
481
482
		$public_key = openssl_get_publickey( JETPACK__DEBUGGER_PUBLIC_KEY );
483
484
		if ( $public_key && openssl_seal( $data, $encrypted_data, $env_key, array( $public_key ) ) ) {
485
			// We are returning base64-encoded values to ensure they're characters we can use in JSON responses without issue.
486
			$return = array(
487
				'data'   => base64_encode( $encrypted_data ), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
488
				'key'    => base64_encode( $env_key[0] ), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
489
				'cipher' => 'RC4', // When Jetpack's minimum WP version is at PHP 5.3+, we will add in detecting and using a stronger one.
490
			);
491
		}
492
493
		openssl_free_key( $public_key );
494
495
		return $return;
496
	}
497
}
498