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

Commit   A

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 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