Completed
Push — master ( 19fab1...ec2cfc )
by ANTHONIUS
23s queued 11s
created

LocalSession::startSession()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2.032

Importance

Changes 0
Metric Value
cc 2
eloc 8
nc 2
nop 1
dl 0
loc 10
ccs 8
cts 10
cp 0.8
crap 2.032
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the doyo/code-coverage project.
5
 *
6
 * (c) Anthonius Munthi <https://itstoni.com>
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\Bridge\CodeCoverage\Session;
15
16
class LocalSession extends AbstractSession
17
{
18 1
    public static function startSession($name): bool
19
    {
20 1
        $self = new static($name);
21
        try {
22 1
            $self->start();
23 1
            return true;
24 1
        } catch (\Exception $exception) {
25 1
            $self->addException($exception);
26 1
            $self->save();
27 1
            return false;
28
        }
29
    }
30
}
31