RawJson   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Swaggest\Json;
4
5
class RawJson implements \JsonSerializable
6
{
7
    const MARKER = '__RAW_JSON__';
8
    private $value;
9
10
    /**
11
     * RawJson constructor.
12
     * @param $value
13
     */
14
    public function __construct($value)
15
    {
16
        $this->value = $value;
17
    }
18
19
    function jsonSerialize()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
20
    {
21
        return self::MARKER . $this->value . self::MARKER;
22
    }
23
}