BasicURLParser   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 12
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
namespace LunixRESTBasics\APIRequest\URLParser;
3
4
use LunixREST\RequestFactory\URLParser\RegexURLParser\RegexURLParser;
5
6
/**
7
 * A basic URL parser. Expects URLS in the format:
8
 * /VERSION/APIKEY/ENDPOINT_NAME[/INSTANCE_ID].EXTENSION[?QUERY_STRING]
9
 * Class BasicURLParser
10
 * @package LunixRESTBasics\APIRequest\URLParser
11
 */
12
class BasicURLParser extends RegexURLParser
13
{
14
    private const URL_PATTERN = "@/(?<version>[^/]*)/(?<apiKey>[^/]*)/(?<endpoint>[^/.]*)(?:/(?<element>[^.]*))?.(?<acceptableExtension>[^/]*)/?@";
15
16
    /**
17
     * BasicURLParser constructor.
18
     */
19 4
    public function __construct()
20
    {
21 4
        parent::__construct(self::URL_PATTERN, new GuzzleMIMEProvider());
22 4
    }
23
}
24