RequestFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 10 2
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