Completed
Push — master ( 946aec...bc2207 )
by mw
03:21
created

src/PropertyRegistry.php (4 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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(
0 ignored issues
show
The method registerProperty() does not exist on SMW\ApprovedRevs\PropertyRegistry. Did you maybe mean register()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
59 1
				$key,
60 1
				$definition['type'],
61 1
				$definition['label'],
62 1
				$definition['visbility']
63
			);
64
65 1
			$propertyRegistry->registerPropertyAlias(
0 ignored issues
show
The method registerPropertyAlias() does not exist on SMW\ApprovedRevs\PropertyRegistry. Did you maybe mean register()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
66 1
				$key,
67 1
				wfMessage( $definition['alias'] )->text()
68
			);
69
70 1
			$propertyRegistry->registerPropertyAliasByMsgKey(
0 ignored issues
show
The method registerPropertyAliasByMsgKey() does not exist on SMW\ApprovedRevs\PropertyRegistry. Did you maybe mean register()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
71 1
				$key,
72 1
				$definition['alias']
73
			);
74
75 1
			$propertyRegistry->registerPropertyDescriptionMsgKeyById(
0 ignored issues
show
The method registerPropertyDescriptionMsgKeyById() does not exist on SMW\ApprovedRevs\PropertyRegistry. Did you maybe mean register()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
76 1
				$key,
77 1
				$definition['desc']
78
			);
79
		}
80 1
	}
81
82
}
83