Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
SiteClassification | |
0.00% |
0 / 6 |
|
0.00% |
0 / 5 |
56 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
12 | |||
set_primary_type | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
set_secondary_type | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
get_primary_type | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
get_secondary_type | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace NewfoldLabs\WP\Module\Onboarding\Types; |
4 | |
5 | /** |
6 | * Site classification data. |
7 | */ |
8 | class SiteClassification { |
9 | |
10 | /** |
11 | * The primary type of the site. |
12 | * |
13 | * @var string |
14 | */ |
15 | private $primary_type; |
16 | |
17 | /** |
18 | * The secondary type of the site. |
19 | * |
20 | * @var string |
21 | */ |
22 | private $secondary_type; |
23 | |
24 | /** |
25 | * Constructor. |
26 | * |
27 | * @param string $primary_type Primary type. |
28 | * @param string $secondary_type Secondary type. |
29 | */ |
30 | public function __construct( string $primary_type, string $secondary_type ) { |
31 | $this->primary_type = ! empty( $primary_type ) ? $primary_type : 'other'; |
32 | $this->secondary_type = ! empty( $secondary_type ) ? $secondary_type : 'other'; |
33 | } |
34 | |
35 | /** |
36 | * Set primary type. |
37 | * |
38 | * @param string $primary_type Primary type. |
39 | */ |
40 | public function set_primary_type( string $primary_type ): void { |
41 | $this->primary_type = $primary_type; |
42 | } |
43 | |
44 | /** |
45 | * Set secondary type. |
46 | * |
47 | * @param string $secondary_type Secondary type. |
48 | */ |
49 | public function set_secondary_type( string $secondary_type ): void { |
50 | $this->secondary_type = $secondary_type; |
51 | } |
52 | |
53 | /** |
54 | * Get primary type. |
55 | * |
56 | * @return string |
57 | */ |
58 | public function get_primary_type(): string { |
59 | return $this->primary_type; |
60 | } |
61 | |
62 | /** |
63 | * Get secondary type. |
64 | * |
65 | * @return string |
66 | */ |
67 | public function get_secondary_type(): string { |
68 | return $this->secondary_type; |
69 | } |
70 | } |