Ajde_Exception   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A traceOnOutput() 0 4 1
A process() 0 4 1
1
<?php
2
3
class Ajde_Exception extends Exception
4
{
5
    protected $_traceOnOutput = true;
6
7
    public function __construct($message = null, $code = 0, $traceOnOutput = true)
8
    {
9
        $this->_traceOnOutput = $traceOnOutput;
10
        parent::__construct($message, $code);
11
    }
12
13
    public function traceOnOutput()
14
    {
15
        return $this->_traceOnOutput;
16
    }
17
18
    public function process()
19
    {
20
        return Ajde_Exception_Handler::handler($this);
0 ignored issues
show
Documentation introduced by
$this is of type this<Ajde_Exception>, but the function expects a object<Throwable>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
21
    }
22
}
23