Passed
Pull Request — develop (#83)
by
unknown
12:02
created

BaseUri::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace InShore\Bookwhen\ValueObjects\Transporter;
6
7
use InShore\Bookwhen\Contracts\StringableContract;
8
9
/**
10
 * @internal
11
 */
12
final class BaseUri implements StringableContract
13
{
14
    /**
15
     * Creates a new Base URI value object.
16
     */
17
    private function __construct(private readonly string $baseUri)
18
    {
19
        // ..
20
    }
21
22
    /**
23
     * Creates a new Base URI value object.
24
     */
25
    public static function from(string $baseUri): self
26
    {
27
        return new self($baseUri);
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function toString(): string
34
    {
35
        return 'https://' . $this->baseUri . '/';
36
    }
37
}
38