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.

RepresentationTestCase   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 38
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 23 3
1
<?php
2
3
namespace Hateoas\Tests\Representation;
4
5
use Hateoas\HateoasBuilder;
6
use Hateoas\Serializer\XmlHalSerializer;
7
use Hateoas\Tests\TestCase;
8
use Hateoas\UrlGenerator\CallableUrlGenerator;
9
10
abstract class RepresentationTestCase extends TestCase
11
{
12
    /**
13
     * @var \Hateoas\Hateoas
14
     */
15
    protected $hateoas;
16
17
    /**
18
     * @var \Hateoas\Hateoas
19
     */
20
    protected $halHateoas;
21
22
    private $queryStringUrlGenerator;
23
24
    protected function setUp()
25
    {
26
        parent::setUp();
27
28
        $this->queryStringUrlGenerator = new CallableUrlGenerator(function ($route, array $parameters, $absolute) {
29
            if ('' !== $queryString = http_build_query($parameters)) {
30
                $queryString = '?' . $queryString;
31
            }
32
33
            return ($absolute ? 'http://example.com' : '') . $route . $queryString;
34
        });
35
36
        $this->hateoas = HateoasBuilder::create()
37
            ->setUrlGenerator(null, $this->queryStringUrlGenerator)
38
            ->build()
39
        ;
40
41
        $this->halHateoas = HateoasBuilder::create()
42
            ->setUrlGenerator(null, $this->queryStringUrlGenerator)
43
            ->setXmlSerializer(new XmlHalSerializer())
44
            ->build()
45
        ;
46
    }
47
}
48