RequestFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
1
<?php
2
3
namespace Dwr\OpenWeather\Factory;
4
5
class RequestFactory
6
{
7
    const REQUEST_NAMESPACE = 'Dwr\\OpenWeather\\Request\\';
8
9
    /**
10
     * @var string
11
     */
12
    private $requestClass;
13
14
    /**
15
     * RequestFactory constructor.
16
     * @param string $requestType
17
     */
18
    public function __construct($requestType)
19
    {
20
        $this->requestClass = self::REQUEST_NAMESPACE . $requestType;
21
    }
22
23
    /**
24
     * @return mixed
25
     */
26
    public function create()
27
    {
28
        return new $this->requestClass();
29
    }
30
}