HelloJob   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A fromArray() 0 3 1
A jsonSerialize() 0 4 1
A getName() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace JCIT\jobqueue\jobs;
5
6
use JCIT\jobqueue\interfaces\JobInterface;
7
8
class HelloJob implements JobInterface
9
{
10 8
    public function __construct(
11
        private string $name
12
    ) {
13 8
    }
14
15 3
    public static function fromArray(array $config): self
16
    {
17 3
        return new static($config['name']);
18
    }
19
20 5
    public function getName(): string
21
    {
22 5
        return $this->name;
23
    }
24
25 3
    public function jsonSerialize(): array
26
    {
27
        return [
28 3
            'name' => $this->name,
29
        ];
30
    }
31
}
32