Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
32 | 30 | public function __construct($url) |
|
33 | { |
||
34 | 30 | $this->url = Http::createFromString($url); |
|
35 | |||
36 | 30 | $this->url = (new RemoveQueryKeys($this->url->query->keys()))->__invoke($this->url); |
|
37 | |||
38 | 30 | preg_match( |
|
39 | 30 | '/\/(.*)\/(.*)\.htm/', |
|
40 | 30 | parse_url($this->url, PHP_URL_PATH), |
|
41 | $matches |
||
42 | 30 | ); |
|
43 | |||
44 | 30 | $this->category = $matches[1]; |
|
45 | 30 | $this->id = $matches[2]; |
|
46 | 30 | } |
|
47 | |||
72 |