JSONWriter::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Jackal\Copycat\Writer;
4
5
/**
6
 * Class JSONWriter
7
 * @package Jackal\Copycat\Writer
8
 */
9
class JSONWriter extends ArrayWriter
10
{
11
    /**
12
     * JSONWriter constructor.
13
     * @param $jsonToWrite
14
     */
15
    public function __construct(&$jsonToWrite)
16
    {
17
        parent::__construct($jsonToWrite);
18
    }
19
20
    /**
21
     *
22
     */
23
    public function finish()
24
    {
25
        $this->outItems = json_encode($this->outItems);
0 ignored issues
show
Documentation Bug introduced by
It seems like json_encode($this->outItems) of type string is incompatible with the declared type array of property $outItems.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
26
    }
27
}
28