Completed
Push — batch-iterator ( dd6368 )
by Davide
02:02
created

StreamUrl   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fromBaseUrlAndName() 0 5 1
A __construct() 0 4 1
A __toString() 0 4 1
1
<?php
2
namespace EventStore\StreamFeed;
3
4
final class StreamUrl
5
{
6
    private $url;
7
8
    /**
9
     * @param string $baseUrl
10
     * @param string $name
11
     */
12 25
    public static function fromBaseUrlAndName($baseUrl, $name)
13
    {
14 25
        $baseUrl = rtrim($baseUrl, '/');
15 25
        return new self("$baseUrl/streams/$name");
16
    }
17
18 25
    private function __construct($url)
19
    {
20 25
        $this->url = $url;
21 25
    }
22
23 25
    public function __toString()
24
    {
25 25
        return $this->url;
26
    }
27
}
28