UnmockableConstructorArgumentException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getClassName() 0 4 1
A getArgumentName() 0 4 1
1
<?php declare(strict_types = 1);
2
3
namespace Mocktainer;
4
5
class UnmockableConstructorArgumentException extends \Exception
6
{
7
8
	/** @var string */
9
	private $className;
10
11
	/** @var string */
12
	private $argumentName;
13
14
	public function __construct(string $className, string $argumentName)
15
	{
16
		parent::__construct(sprintf(
17
			'Constructor argument "%s" of class %s cannot be mocked',
18
			$argumentName,
19
			$className
20
		));
21
22
		$this->className = $className;
23
		$this->argumentName = $argumentName;
24
	}
25
26
	public function getClassName(): string
27
	{
28
		return $this->className;
29
	}
30
31
	public function getArgumentName(): string
32
	{
33
		return $this->argumentName;
34
	}
35
36
}
37