Passed
Push — master ( 1a8193...4ba352 )
by Alexander
02:01
created

Commit::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
c 1
b 0
f 0
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 6
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Vasoft\VersionIncrement\Commits;
6
7
final class Commit
8
{
9 15
    public function __construct(
10
        public readonly string $rawMessage,
11
        public readonly string $type,
12
        public readonly string $comment,
13
        public readonly bool $breakingChange,
14
        public readonly string $scope = '',
15
        public readonly array $flags = [],
16 15
    ) {}
17
18 2
    public function withType(string $detectedKey): self
19
    {
20 2
        return new self(
21 2
            $this->rawMessage,
22 2
            $detectedKey,
23 2
            $this->comment,
24 2
            $this->breakingChange,
25 2
            $this->scope,
26 2
            $this->flags,
27 2
        );
28
    }
29
}
30