GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d8610c...90cf5c )
by Sergey
08:02
created

Factory::createRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 1
cts 1
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/*
3
 * This file is part of the reva2/jsonapi.
4
 *
5
 * (c) Sergey Revenko <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Reva2\JsonApi\Factories;
12
13
use Neomerx\JsonApi\Contracts\Codec\CodecMatcherInterface;
14
use Neomerx\JsonApi\Contracts\Schema\ContainerInterface;
15
use Neomerx\JsonApi\Encoder\EncoderOptions;
16
use Neomerx\JsonApi\Factories\Factory as BaseFactory;
17
use Reva2\JsonApi\Contracts\Factories\FactoryInterface;
18
use Reva2\JsonApi\Contracts\Services\EnvironmentInterface;
19
use Reva2\JsonApi\Encoder\Encoder;
20
use Reva2\JsonApi\Http\Headers\HeadersChecker;
21
use Reva2\JsonApi\Http\Query\QueryParametersParser;
22
use Reva2\JsonApi\Http\Request;
23
use Reva2\JsonApi\Schema\Container;
24
use Reva2\JsonApi\Services\Environment;
25
26
/**
27
 * JSON API factory
28
 *
29
 * @package Reva2\JsonApi\Factories
30
 * @author Sergey Revenko <[email protected]>
31
 */
32
class Factory extends BaseFactory implements FactoryInterface
33
{
34
    /**
35
     * @inheritdoc
36 2
     */
37
    public function createEncoder(ContainerInterface $container, EncoderOptions $encoderOptions = null)
38 2
    {
39 2
        $encoder = new Encoder($this, $container, $encoderOptions);
40
        $encoder->setLogger($this->logger);
41 2
42
        return $encoder;
43
    }
44
45
    /**
46
     * @inheritdoc
47 4
     */
48
    public function createHeadersChecker(CodecMatcherInterface $codecMatcher)
49 4
    {
50
        return new HeadersChecker($codecMatcher);
51
    }
52
53
    /**
54
     * @inheritdoc
55 2
     */
56
    public function createEnvironment(array $config = null)
57 2
    {
58
        return new Environment($config);
59
    }
60
61
    /**
62
     * @inheritdoc
63 3
     */
64
    public function createRequest(EnvironmentInterface $environment)
65 3
    {
66
        return new Request($environment);
67
    }
68
69
    /**
70
     * @inheritdoc
71 2
     */
72
    public function createQueryParametersParser()
73 2
    {
74
        return new QueryParametersParser();
75
    }
76
77
    /**
78
     * @inheritdoc
79
     */
80
    public function createContainer(array $providers = [])
81
    {
82
        $container = new Container($this, $providers);
83
        $container->setLogger($this->logger);
84
85
        return $container;
86
    }
87
}
88