ParamsListService   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 9
c 1
b 0
f 0
dl 0
loc 32
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getServiceName() 0 3 1
A getRouteId() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the SF Forward Bundle.
5
 *
6
 * (c) DAOUDI Soufian <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace SfForward\Util;
13
14
use Nayjest\StrCaseConverter\Str;
15
16
/**
17
 * Class ParamsListService.
18
 */
19
class ParamsListService
20
{
21
    protected $serviceName;
22
    protected $routeId;
23
24
    /**
25
     * ParamsListService constructor.
26
     *
27
     * @param string $paramsList
28
     */
29
    public function __construct($paramsList)
30
    {
31
        list($this->serviceName, $this->routeId) = explode('&', $paramsList);
32
        $this->serviceName = str_replace('service=', '', $this->serviceName);
33
        $this->routeId = str_replace('routeId=', '', $this->routeId);
34
        $this->routeId = str_replace('_', '/', $this->routeId);
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getServiceName()
41
    {
42
        return Str::toSnakeCase($this->serviceName);
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getRouteId()
49
    {
50
        return $this->routeId;
51
    }
52
}
53