Completed
Push — master ( ce7b38...6ec792 )
by Peter
04:34
created

UriFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 6 1
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
namespace GpsLab\Component\Sitemap\Uri;
10
11
class UriFactory
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $url_class = '';
17
18
    /**
19
     * @param string $url_class
20
     */
21
    public function __construct($url_class)
22
    {
23
        $this->url_class = $url_class;
24
    }
25
26
    /**
27
     * @param string $loc
28
     *
29
     * @return UriInterface
30
     */
31
    public function create($loc)
32
    {
33
        $class_name = $this->url_class;
34
        /* @var $url UriInterface */
35
        return new $class_name($loc);
36
    }
37
}
38