PatternRequiresValues   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 0
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_pattern() 0 4 1
A __construct() 0 6 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\Routing;
13
14
use ICanBoogie\Accessor\AccessorTrait;
15
16
/**
17
 * Exception thrown in attempt to format a pattern requiring values without providing any.
18
 *
19
 * @property-read Pattern $pattern
20
 */
21
class PatternRequiresValues extends \InvalidArgumentException implements Exception
22
{
23
	use AccessorTrait;
24
25
	/**
26
	 * @var Pattern
27
	 */
28
	private $pattern;
29
30
	protected function get_pattern()
31
	{
32
		return $this->pattern;
33
	}
34
35
	/**
36
	 * @param Pattern $pattern
37
	 * @param string $message
38
	 * @param int $code
39
	 * @param \Exception|null $previous
40
	 */
41
	public function __construct(Pattern $pattern, $message = "The pattern requires values to be formatted.", $code = 500, \Exception $previous = null)
42
	{
43
		$this->pattern = $pattern;
44
45
		parent::__construct($message, $code, $previous);
46
	}
47
}
48