Passed
Push — master ( c0f32c...e879f4 )
by Chema
04:17 queued 41s
created

Symbol::empty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chemaclass\StockTicker\Domain\ReadModel;
6
7
/**
8
 * @psalm-immutable
9
 */
10
final class Symbol
11
{
12
    private string $symbol;
13
14
    /**
15
     * @psalm-pure
16
     */
17 8
    public static function fromString(string $symbol): self
18
    {
19 8
        return new self($symbol);
20
    }
21
22
    /**
23
     * @psalm-pure
24
     */
25
    public static function empty(): self
26
    {
27
        return new self('');
28
    }
29
30 8
    private function __construct(string $symbol)
31
    {
32 8
        $this->symbol = $symbol;
33 8
    }
34
35 8
    public function toString(): string
36
    {
37 8
        return $this->symbol;
38
    }
39
}
40