Completed
Branch master (91c650)
by Ryuichi
05:32 queued 02:45
created

InvalidArgumentException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace WebStream\Exception\Extend;
3
4
use WebStream\Exception\SystemException;
5
6
/**
7
 * InvalidArgumentException
8
 * @author Ryuichi TANAKA.
9
 * @since 2014/05/06
10
 * @version 0.4
11
 */
12
class InvalidArgumentException extends SystemException
13
{
14
    /**
15
     * constructor
16
     */
17
    public function __construct($message = null)
18
    {
19
        parent::__construct($message, 500, $this);
0 ignored issues
show
Documentation introduced by
$this is of type this<WebStream\Exception...validArgumentException>, but the function expects a object<WebStream\Exception\Exception>|null.

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...
20
    }
21
}
22