getArguments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php declare(strict_types = 1);
2
3
namespace Mocktainer;
4
5
class UnknownConstructorArgumentsException extends \Exception
6
{
7
8
	/** @var string */
9
	private $className;
10
11
	/** @var mixed[] */
12
	private $arguments;
13
14
	/**
15
	 * @param string $className
16
	 * @param mixed[] $arguments name(string) => value(mixed)
17
	 */
18
	public function __construct(string $className, array $arguments)
19
	{
20
		parent::__construct(sprintf(
21
			'Passed unknown constructor arguments for class %s: %s',
22
			$className,
23
			implode(', ', array_keys($arguments))
24
		));
25
26
		$this->className = $className;
27
		$this->arguments = $arguments;
28
	}
29
30
	public function getClassName(): string
31
	{
32
		return $this->className;
33
	}
34
35
	/**
36
	 * @return mixed[]
37
	 */
38
	public function getArguments(): array
39
	{
40
		return $this->arguments;
41
	}
42
43
}
44