GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Descriptor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 136
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 136
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 21 1
A __construct() 0 1 1
1
<?php
2
3
/*
4
 * This file is part of the ICanBoogie package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ICanBoogie\Module;
13
14
/**
15
 * Module descriptor options.
16
 *
17
 * @package ICanBoogie\Module
18
 */
19
final class Descriptor
20
{
21
	/**
22
	 * Defines the category for the module.
23
	 *
24
	 * When modules are listed they are usually grouped by category. The category is also often
25
	 * used to create the main navigation menu of the admin interface.
26
	 *
27
	 * The category of the module is translated within the `module_category` scope.
28
	 */
29
	const CATEGORY = 'category';
30
31
	/**
32
	 * Defines the PHP class of the module.
33
	 *
34
	 * If the class is not defined it is resolved during indexing using the {@link NS}
35
	 * tag and the following pattern : `<namespace>\Module`.
36
	 */
37
	const CLASSNAME = 'class';
38
39
	/**
40
	 * Defines a short description of what the module do.
41
	 */
42
	const DESCRIPTION = 'description';
43
44
	/**
45
	 * Defines the state of the module.
46
	 */
47
	const DISABLED = 'disabled';
48
49
	/**
50
	 * Defines extra values.
51
	 */
52
	const EXTRA = 'extra';
53
54
	/**
55
	 * Defines the parent module the module inherits from.
56
	 */
57
	const INHERITS = 'inherits';
58
59
	/**
60
	 * Defines the identifier of the module.
61
	 *
62
	 * If the identifier is not defined the name of the module directory is used instead.
63
	 */
64
	const ID = 'id';
65
66
	/**
67
	 * Defines the state of the module.
68
	 *
69
	 * Required modules are always enabled.
70
	 */
71
	const REQUIRED = 'required';
72
73
	/**
74
	 * Defines the modules that the module requires.
75
	 *
76
	 * The required modules are defined using an array of identifiers.
77
	 */
78
	const REQUIRES = 'requires';
79
80
	/**
81
	 * Defines the models of the module.
82
	 */
83
	const MODELS = 'models';
84
85
	/**
86
	 * Defines the namespace of the module.
87
	 *
88
	 * This attribute must be defined at construct time.
89
	 */
90
	const NS = 'namespace';
91
92
	/**
93
	 * Path to the module's directory.
94
	 *
95
	 * This tag is resolved when the module is indexed.
96
	 */
97
	const PATH = 'path';
98
99
	/**
100
	 * General permission of the module.
101
	 */
102
	const PERMISSION = 'permission';
103
104
	/**
105
	 * Defines the permissions added by the module.
106
	 */
107
	const PERMISSIONS = 'permissions';
108
109
	/**
110
	 * Defines the title of the module.
111
	 *
112
	 * The title of the module is translated within the `module_title` scope.
113
	 */
114
	const TITLE = 'title';
115
116
	/**
117
	 * Defines the weight of the module.
118
	 *
119
	 * The weight of the module is resolved during modules indexing according to the
120
	 * {@link EXTENDS} and {@link REQUIRES} tags.
121
	 */
122
	const WEIGHT = 'weight';
123
124
	/**
125
	 * Normalizes a descriptor array.
126
	 *
127
	 * @param array $descriptor
128
	 *
129
	 * @return array
130
	 */
131
	static public function normalize(array $descriptor)
132
	{
133
		return $descriptor + [
134
135
			Descriptor::CATEGORY => null,
136
			Descriptor::CLASSNAME => $descriptor[Descriptor::NS] . '\Module',
137
			Descriptor::DESCRIPTION => null,
138
			Descriptor::DISABLED => false,
139
			Descriptor::EXTRA => [],
140
			Descriptor::INHERITS => null,
141
			Descriptor::ID => null,
142
			Descriptor::MODELS => [],
143
			Descriptor::PATH => null,
144
			Descriptor::PERMISSION => null,
145
			Descriptor::PERMISSIONS => [],
146
			Descriptor::REQUIRED => false,
147
			Descriptor::REQUIRES => [],
148
			Descriptor::WEIGHT => 0
149
150
		];
151
	}
152
153
	private function __construct() {}
154
}
155