Completed
Push — master ( 3c6179...89260f )
by Stephanie
47:59
created

FrmInstallerSkin   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 67
rs 10
c 0
b 0
f 0
wmc 8
lcom 0
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A set_upgrader() 0 5 2
A set_result() 0 3 1
A header() 0 1 1
A footer() 0 1 1
A error() 0 6 2
A feedback() 0 1 1
1
<?php
2
/**
3
 * @since 3.04.02
4
 *
5
 * @subpackage  Upgrader Skin
6
 */
7
8
// Exit if accessed directly
9
if ( ! defined( 'ABSPATH' ) ) {
10
	exit;
11
}
12
13
class FrmInstallerSkin extends WP_Upgrader_Skin {
14
15
	/**
16
	 * Set the upgrader object and store it as a property in the parent class.
17
	 *
18
	 * @since 3.04.02
19
	 *
20
	 * @param object $upgrader The upgrader object (passed by reference).
21
	 */
22
	public function set_upgrader( &$upgrader ) {
23
		if ( is_object( $upgrader ) ) {
24
			$this->upgrader =& $upgrader;
25
		}
26
	}
27
28
	/**
29
	 * Set the upgrader result and store it as a property in the parent class.
30
	 *
31
	 * @since 3.04.02
32
	 *
33
	 * @param object $result The result of the install process.
34
	 */
35
	public function set_result( $result ) {
36
		$this->result = $result;
37
	}
38
39
	/**
40
	 * Empty out the header of its HTML content and only check to see if it has
41
	 * been performed or not.
42
	 *
43
	 * @since 3.04.02
44
	 */
45
	public function header() {}
46
47
	/**
48
	 * Empty out the footer of its HTML contents.
49
	 *
50
	 * @since 3.04.02
51
	 */
52
	function footer() {}
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
53
54
	/**
55
	 * Instead of outputting HTML for errors, json_encode the errors and send them
56
	 * back to the Ajax script for processing.
57
	 *
58
	 * @since 3.04.02
59
	 *
60
	 * @param array $errors Array of errors with the install process.
61
	 */
62
	function error( $errors ) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
63
		if ( ! empty( $errors ) ) {
64
			echo json_encode( array( 'error' => $errors->get_error_message() ) );
0 ignored issues
show
Bug introduced by
The method get_error_message cannot be called on $errors (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
65
			wp_die();
66
		}
67
	}
68
69
	/**
70
	 * Empty out the feedback method to prevent outputting HTML strings as the install
71
	 * is progressing.
72
	 *
73
	 * @since 3.04.02
74
	 *
75
	 * @param string $string The feedback string.
76
	 */
77
	function feedback( $string ) {}
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
78
79
}
80