RequestFactory::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 11/21/15
5
 * Time: 3:26 PM.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace NilPortugues\Api\JsonApi\Http\Factory;
11
12
use NilPortugues\Api\JsonApi\Http\Request\Request;
13
14
/**
15
 * Class RequestFactory.
16
 */
17
class RequestFactory
18
{
19
    /**
20
     * @var Request
21
     */
22
    protected static $request;
23
24
    /**
25
     * @return Request
26
     */
27
    public static function create()
28
    {
29
        if (self::$request) {
30
            return self::$request;
31
        }
32
33
        self::$request = new Request();
34
35
        return self::$request;
36
    }
37
}
38