RequestFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
}