Conditions | 4 |
Paths | 8 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
35 | 20 | public function __construct($path, $fullUrl, $referer = null, \DateTime $timestamp = null) |
|
36 | { |
||
37 | 20 | if (null === $timestamp) { |
|
38 | 20 | $timestamp = new \DateTime('now'); |
|
39 | } |
||
40 | |||
41 | 20 | $path = \trim($path); |
|
42 | 20 | $path = !empty($path) ? $path : null; |
|
43 | |||
44 | 20 | if (null !== $path) { |
|
45 | 18 | $path = '/'.\ltrim(\parse_url($path, \PHP_URL_PATH), '/'); |
|
46 | } |
||
47 | |||
48 | 20 | $this->path = $path; |
|
49 | 20 | $this->fullUrl = $fullUrl; |
|
50 | 20 | $this->referer = $referer; |
|
51 | 20 | $this->timestamp = $timestamp; |
|
52 | 20 | } |
|
53 | |||
86 |