1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SMW\ApprovedRevs; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* @license GNU GPL v2+ |
7
|
|
|
* @since 1.0 |
8
|
|
|
* |
9
|
|
|
* @author mwjames |
10
|
|
|
*/ |
11
|
|
|
class PropertyRegistry { |
12
|
|
|
|
13
|
|
|
const SAR_PROP_APPROVED_REV = '__sar_approved_rev'; |
14
|
|
|
const SAR_PROP_APPROVED_BY = '__sar_approved_by'; |
15
|
|
|
const SAR_PROP_APPROVED_DATE = '__sar_approved_date'; |
16
|
|
|
const SAR_PROP_APPROVED_STATUS = '__sar_approved_status'; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @since 1.0 |
20
|
|
|
* |
21
|
|
|
* @param PropertyRegistry $propertyRegistry |
22
|
|
|
*/ |
23
|
1 |
|
public function register( $propertyRegistry ) { |
24
|
|
|
|
25
|
|
|
$defs = [ |
26
|
1 |
|
self::SAR_PROP_APPROVED_REV => [ |
27
|
|
|
'label' => 'Approved revision', |
28
|
|
|
'type' => '_num', |
29
|
|
|
'alias' => 'semantic-approvedrevs-property-approved-rev', |
30
|
|
|
'desc' => 'semantic-approvedrevs-property-approved-rev-desc', |
31
|
|
|
'visbility' => false |
32
|
|
|
], |
33
|
1 |
|
self::SAR_PROP_APPROVED_BY => [ |
34
|
|
|
'label' => 'Approved by', |
35
|
|
|
'type' => '_wpg', |
36
|
|
|
'alias' => 'semantic-approvedrevs-property-approved-by', |
37
|
|
|
'desc' => 'semantic-approvedrevs-property-approved-by-desc', |
38
|
|
|
'visbility' => false |
39
|
|
|
], |
40
|
1 |
|
self::SAR_PROP_APPROVED_DATE => [ |
41
|
|
|
'label' => 'Approved date', |
42
|
|
|
'type' => '_dat', |
43
|
|
|
'alias' => 'semantic-approvedrevs-property-approved-date', |
44
|
|
|
'desc' => 'semantic-approvedrevs-property-approved-date-desc', |
45
|
|
|
'visbility' => false |
46
|
|
|
], |
47
|
1 |
|
self::SAR_PROP_APPROVED_STATUS => [ |
48
|
|
|
'label' => 'Approval status', |
49
|
|
|
'type' => '_txt', |
50
|
|
|
'alias' => 'semantic-approvedrevs-property-approved-status', |
51
|
|
|
'desc' => 'semantic-approvedrevs-property-approved-status-desc', |
52
|
|
|
'visbility' => false |
53
|
|
|
] |
54
|
|
|
]; |
55
|
|
|
|
56
|
1 |
|
foreach ( $defs as $key => $definition ) { |
57
|
|
|
|
58
|
1 |
|
$propertyRegistry->registerProperty( |
|
|
|
|
59
|
1 |
|
$key, |
60
|
1 |
|
$definition['type'], |
61
|
1 |
|
$definition['label'], |
62
|
1 |
|
$definition['visbility'] |
63
|
|
|
); |
64
|
|
|
|
65
|
1 |
|
$propertyRegistry->registerPropertyAlias( |
|
|
|
|
66
|
1 |
|
$key, |
67
|
1 |
|
wfMessage( $definition['alias'] )->text() |
|
|
|
|
68
|
|
|
); |
69
|
|
|
|
70
|
1 |
|
$propertyRegistry->registerPropertyAliasByMsgKey( |
|
|
|
|
71
|
1 |
|
$key, |
72
|
1 |
|
$definition['alias'] |
73
|
|
|
); |
74
|
|
|
|
75
|
1 |
|
$propertyRegistry->registerPropertyDescriptionMsgKeyById( |
|
|
|
|
76
|
1 |
|
$key, |
77
|
1 |
|
$definition['desc'] |
78
|
|
|
); |
79
|
|
|
} |
80
|
1 |
|
} |
81
|
|
|
|
82
|
|
|
} |
83
|
|
|
|
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.