Passed
Push — master ( 734f70...83757e )
by ANTHONIUS
05:42 queued 03:19
created

LocalSession   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 15
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A startSession() 0 13 2
1
<?php
2
3
/*
4
 * This file is part of the doyo/behat-code-coverage project.
5
 *
6
 * (c) Anthonius Munthi <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Doyo\Behat\Coverage\Bridge\CodeCoverage\Session;
15
16
class LocalSession extends Session
17
{
18 8
    public static function startSession($name): bool
19
    {
20 1
        $self = new static($name);
21
        try {
22 1
            $self->start();
23 8
            register_shutdown_function([$self, 'shutdown']);
24
25 8
            return true;
26 1
        } catch (\Exception $exception) {
27 1
            $self->addException($exception);
28 1
            $self->save();
29
30 1
            return false;
31
        }
32
    }
33
}
34