InvalidFieldException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 18
loc 18
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * @package   Fuel\Validation
4
 * @version   2.0
5
 * @author    Fuel Development Team
6
 * @license   MIT License
7
 * @copyright 2010 - 2013 Fuel Development Team
8
 * @link      http://fuelphp.com
9
 */
10
11
namespace Fuel\Validation;
12
13
use Exception;
14
use InvalidArgumentException;
15
16
/**
17
 * Thrown when a specified field is invalid
18
 *
19
 * @package Fuel\Validation
20
 * @author  Fuel Development Team
21
 *
22
 * @since   2.0
23
 */
24 View Code Duplication
class InvalidFieldException extends InvalidArgumentException
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
{
26
27
	/**
28
	 * @param string     $message  This is expected to be left blank or be a field name
29
	 * @param int        $code
30
	 * @param \Exception $previous
31
	 *
32
	 * @since 2.0
33
	 */
34 8
	public function __construct($message = '', $code = 0, Exception $previous = null)
35
	{
36 8
		$error = 'VAL-002: The field ['.$message.'] is not known.';
37
38 8
		parent::__construct($error, $code, $previous);
39 8
	}
40
41
}
42