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.

ModuleConstructorMissing   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 53
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get_module_id() 0 4 1
A get_class() 0 4 1
A __construct() 0 12 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
use ICanBoogie\Accessor\AccessorTrait;
15
use ICanBoogie\HTTP\Status;
16
17
/**
18
 * Exception thrown when a class is missing to instantiate a module.
19
 *
20
 * @property-read string $module_id The identifier of the module.
21
 * @property-read string $class The name of the missing class.
22
 */
23
class ModuleConstructorMissing extends \RuntimeException
24
{
25
	use AccessorTrait;
26
27
	/**
28
	 * Identifier of the module.
29
	 *
30
	 * @var string
31
	 */
32
	private $module_id;
33
34
	/**
35
	 * @return string
36
	 */
37
	protected function get_module_id()
38
	{
39
		return $this->module_id;
40
	}
41
42
	/**
43
	 * Class name of the module.
44
	 *
45
	 * @var string
46
	 */
47
	private $class;
48
49
	/**
50
	 * @return string
51
	 */
52
	protected function get_class()
53
	{
54
		return $this->class;
55
	}
56
57
	/**
58
	 * @param string $module_id
59
	 * @param string $class
60
	 * @param \Exception|int $code
61
	 * @param \Exception|null $previous
62
	 */
63
	public function __construct($module_id, $class, $code = Status::INTERNAL_SERVER_ERROR, \Exception $previous = null)
0 ignored issues
show
Unused Code introduced by
The parameter $previous is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
64
	{
65
		$this->module_id = $module_id;
66
		$this->class = $class;
67
68
		parent::__construct(\ICanBoogie\format('Missing class %class to instantiate module %id.', [
69
70
			'class' => $class,
71
			'id' => $module_id
72
73
		]));
74
	}
75
}
76