Exception   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
3
namespace OpenBuildings\PayPal;
4
5
/**
6
 * @author Haralan Dobrev <[email protected]>
7
 * @copyright 2013 OpenBuildings, Inc.
8
 * @license http://spdx.org/licenses/BSD-3-Clause
9
 */
10
class Exception extends \Exception {
11
12
	public function __construct($message, $variables = array(), \Exception $previous = NULL)
13
	{
14
		if ($variables)
0 ignored issues
show
Bug Best Practice introduced by
The expression $variables of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
15
		{
16
			$message = strtr($message, $variables);
17
		}
18
19
		parent::__construct($message, 0, $previous);
20
	}
21
}