PropertyRegistry   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 45
c 1
b 0
f 0
dl 0
loc 67
ccs 20
cts 20
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 55 2
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
Bug introduced by
The method registerProperty() does not exist on SMW\ApprovedRevs\PropertyRegistry. Did you maybe mean register()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

58
			$propertyRegistry->/** @scrutinizer ignore-call */ 
59
                      registerProperty(

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.

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
Bug introduced by
The method registerPropertyAlias() does not exist on SMW\ApprovedRevs\PropertyRegistry. Did you maybe mean register()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

65
			$propertyRegistry->/** @scrutinizer ignore-call */ 
66
                      registerPropertyAlias(

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.

Loading history...
66 1
				$key,
67 1
				wfMessage( $definition['alias'] )->text()
0 ignored issues
show
Bug introduced by
The function wfMessage was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

67
				/** @scrutinizer ignore-call */ 
68
    wfMessage( $definition['alias'] )->text()
Loading history...
68
			);
69
70 1
			$propertyRegistry->registerPropertyAliasByMsgKey(
0 ignored issues
show
Bug introduced by
The method registerPropertyAliasByMsgKey() does not exist on SMW\ApprovedRevs\PropertyRegistry. Did you maybe mean register()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

70
			$propertyRegistry->/** @scrutinizer ignore-call */ 
71
                      registerPropertyAliasByMsgKey(

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.

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

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

75
			$propertyRegistry->/** @scrutinizer ignore-call */ 
76
                      registerPropertyDescriptionMsgKeyById(

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.

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