Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 45 |
|
0.00% |
0 / 12 |
CRAP | |
0.00% |
0 / 1 |
PFYearInput | |
0.00% |
0 / 45 |
|
0.00% |
0 / 12 |
156 | |
0.00% |
0 / 1 |
getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDefaultPropTypes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getOtherPropTypesHandled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDefaultPropTypeLists | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getOtherPropTypeListsHandled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDefaultCargoTypes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getOtherCargoTypesHandled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDefaultCargoTypeLists | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getOtherCargoTypeListsHandled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getHTML | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
getParameters | |
0.00% |
0 / 27 |
|
0.00% |
0 / 1 |
2 | |||
getHtmlText | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * @file |
4 | * @ingroup PF |
5 | */ |
6 | |
7 | /** |
8 | * @ingroup PFFormInput |
9 | */ |
10 | class PFYearInput extends PFTextInput { |
11 | |
12 | public static function getName(): string { |
13 | return 'year'; |
14 | } |
15 | |
16 | public static function getDefaultPropTypes() { |
17 | return []; |
18 | } |
19 | |
20 | public static function getOtherPropTypesHandled() { |
21 | return [ '_dat' ]; |
22 | } |
23 | |
24 | public static function getDefaultPropTypeLists() { |
25 | return []; |
26 | } |
27 | |
28 | public static function getOtherPropTypeListsHandled() { |
29 | return []; |
30 | } |
31 | |
32 | public static function getDefaultCargoTypes() { |
33 | return []; |
34 | } |
35 | |
36 | public static function getOtherCargoTypesHandled() { |
37 | return [ 'Date' ]; |
38 | } |
39 | |
40 | public static function getDefaultCargoTypeLists() { |
41 | return []; |
42 | } |
43 | |
44 | public static function getOtherCargoTypeListsHandled() { |
45 | return []; |
46 | } |
47 | |
48 | public static function getHTML( $cur_value, $input_name, $is_mandatory, $is_disabled, array $other_args ) { |
49 | $other_args['size'] = 4; |
50 | return parent::getHTML( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ); |
51 | } |
52 | |
53 | public static function getParameters() { |
54 | $params = []; |
55 | $params[] = [ |
56 | 'name' => 'mandatory', |
57 | 'type' => 'boolean', |
58 | 'description' => wfMessage( 'pf_forminputs_mandatory' )->text() |
59 | ]; |
60 | $params[] = [ |
61 | 'name' => 'restricted', |
62 | 'type' => 'boolean', |
63 | 'description' => wfMessage( 'pf_forminputs_restricted' )->text() |
64 | ]; |
65 | $params[] = [ |
66 | 'name' => 'class', |
67 | 'type' => 'string', |
68 | 'description' => wfMessage( 'pf_forminputs_class' )->text() |
69 | ]; |
70 | $params[] = [ |
71 | 'name' => 'default', |
72 | 'type' => 'string', |
73 | 'description' => wfMessage( 'pf_forminputs_default' )->text() |
74 | ]; |
75 | $params[] = [ |
76 | 'name' => 'size', |
77 | 'type' => 'int', |
78 | 'description' => wfMessage( 'pf_forminputs_size' )->text() |
79 | ]; |
80 | return $params; |
81 | } |
82 | |
83 | /** |
84 | * Returns the HTML code to be included in the output page for this input. |
85 | * @return string |
86 | */ |
87 | public function getHtmlText(): string { |
88 | return self::getHTML( |
89 | $this->mCurrentValue, |
90 | $this->mInputName, |
91 | $this->mIsMandatory, |
92 | $this->mIsDisabled, |
93 | $this->mOtherArgs |
94 | ); |
95 | } |
96 | } |