Completed
Push — master ( bd4c23...b341c0 )
by Filipe
10:29
created

Uri   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPath() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of slick/mvc package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Mvc\Http\UrlRewriter;
11
12
use Psr\Http\Message\UriInterface;
13
14
/**
15
 * Uri
16
 *
17
 * @package Slick\Mvc\Http\UrlRewriter
18
 * @author  Filipe Silva <[email protected]>
19
 */
20
class Uri extends \Slick\Http\Uri implements UriInterface
21
{
22
23
    /**
24
     * Retrieve the path segment of the URI.
25
     *
26
     * This method always return a string; if no path is present it will return
27
     * a '/' string to properly be routed by Aura Router. This differs from
28
     * the PSR-7 recommended implementation with this method should return an
29
     * empty string if the path is not present.
30
     *
31
     * @return string The path segment of the URI.
32
     */
33
    public function getPath()
34
    {
35
        $path = parent::getPath();
36
        return str_replace('//', '/', "/$path");
37
    }
38
}