AbstractSerialiser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 11
c 2
b 0
f 0
dl 0
loc 41
ccs 10
cts 10
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A factory() 0 6 1
1
<?php
2
/**
3
 * This file is part of graze/unicontroller-client.
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/unicontroller-client/blob/master/LICENSE.md
11
 * @link https://github.com/graze/unicontroller-client
12
 */
13
namespace Graze\UnicontrollerClient\Serialiser\Serialiser;
14
15
use Graze\UnicontrollerClient\Serialiser\SerialiserResolver;
16
use Graze\UnicontrollerClient\StringEscaper;
17
use Graze\UnicontrollerClient\Serialiser\ArraySerialiser;
18
use Graze\UnicontrollerClient\Serialiser\BinaryDataSerialiser;
19
20
abstract class AbstractSerialiser
21
{
22
    /**
23
     * @var StringEscaper
24
     */
25
    protected $stringEscaper;
26
27
    /**
28
     * @var ArraySerialiser
29
     */
30
    protected $arraySerialiser;
31
32
    /**
33
     * @var BinaryDataSerialiser
34
     */
35
    protected $binaryDataSerialiser;
36
37
    /**
38
     * @param StringEscaper $stringEscaper
39
     * @param ArraySerialiser $arraySerialiser
40
     * @param BinaryDataSerialiser $binaryDataSerialiser
41
     */
42 19
    public function __construct(
43
        StringEscaper $stringEscaper,
44
        ArraySerialiser $arraySerialiser,
45
        BinaryDataSerialiser $binaryDataSerialiser
46
    ) {
47 19
        $this->stringEscaper = $stringEscaper;
48 19
        $this->arraySerialiser = $arraySerialiser;
49 19
        $this->binaryDataSerialiser = $binaryDataSerialiser;
50 19
    }
51
52
    /**
53
     * @return AbstractParser
0 ignored issues
show
Bug introduced by
The type Graze\UnicontrollerClien...rialiser\AbstractParser was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
54
     */
55 19
    public static function factory()
56
    {
57 19
        return new static(
0 ignored issues
show
Bug Best Practice introduced by
The expression return new static(new Gr...BinaryDataSerialiser()) returns the type Graze\UnicontrollerClien...iser\AbstractSerialiser which is incompatible with the documented return type Graze\UnicontrollerClien...rialiser\AbstractParser.
Loading history...
58 19
            new StringEscaper(),
59 19
            ArraySerialiser::factory(),
60 19
            new BinaryDataSerialiser()
61 19
        );
62
    }
63
}
64