Issues (10)

src/Writer/JSONWriter.php (1 issue)

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