Commit::__construct()   A
last analyzed

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 29
    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 29
    ) {}
17
18 3
    public function withType(string $detectedKey): self
19
    {
20 3
        return new self(
21 3
            $this->rawMessage,
22 3
            $detectedKey,
23 3
            $this->comment,
24 3
            $this->breakingChange,
25 3
            $this->scope,
26 3
            $this->flags,
27 3
        );
28
    }
29
}
30