Passed
Branch master (eb3c74)
by Michał
01:57
created

SimpleClass::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 3
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
ccs 5
cts 5
cp 1
crap 2
1
<?php
2
3
namespace Test\TestClass;
4
5
class SimpleClass
6
{
7
    /**
8
     * @var array
9
     */
10
    public $constructorArgs = [];
11
12
    /**
13
     * SimpleClass constructor.
14
     *
15
     * @param int $arg1
16
     * @param int $arg2
17
     * @param bool $exception
18
     * @throws \LogicException
19
     */
20
    public function __construct($arg1 = 0, $arg2 = 0, $exception = false)
21
    {
22
        if ($exception) {
23
            throw new \LogicException('Test exception.');
24
        }
25
26
        $this->constructorArgs[] = $arg1;
27
        $this->constructorArgs[] = $arg2;
28
    }
29
30
    /**
31
     * @return int
32
     */
33
    public function testMe()
34
    {
35
        return 1;
36
    }
37
}
38