Commit   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 20
ccs 10
cts 10
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A withType() 0 9 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