Symbol::empty()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
    private function __construct(string $symbol)
15
    {
16
        $this->symbol = $symbol;
17 7
    }
18
19 7
    /**
20
     * @psalm-pure
21
     */
22
    public static function fromString(string $symbol): self
23
    {
24
        return new self($symbol);
25
    }
26
27
    /**
28
     * @psalm-pure
29
     */
30 7
    public static function empty(): self
31
    {
32 7
        return new self('');
33 7
    }
34
35 7
    public function toString(): string
36
    {
37 7
        return $this->symbol;
38
    }
39
}
40