src/Analyse/AbstractModel.php
public function addToJson($key, $value)
    {
        // Remove leftover linebreaks.
        $value = trim(preg_replace("/\r|\n/", "", $value));
        if ($value === '') {
            unset($this->json[$key]);
        } else {
            $this->json[$key] = $value;
        }

        return $this;
    }
public function addToJson($key, $value)
    {
        // Remove leftover linebreaks.
        $value = trim(preg_replace("/\r|\n/", "", $value));
        if ($value === '') {
            unset($this->json[$key]);
        } else {
            $this->json[$key] = $value;
        }

        return $this;
    }
public function addToJson ( $ key , $ value ) { // Remove leftover linebreaks. $ value = trim ( preg_replace ( "/\r|\n/" , "" , $ value ) ) ; if ( $ value === '' ) { unset ( $ this -> json [ $ key ] ) ; } else { $ this -> json [ $ key ] = $ value ; } return $ this ; }
We simply add more info to our info json.
Leftover linebreaks will be removed.
If the value is empty, we will remove a possible previous entry to this key.

@param string $key
The array key.
@param string $value
The value we want to set.

@return $this
$this for chaining.
We simply add more info to our info json . Leftover linebreaks will be removed . If the value is empty we will remove a possible previous entry to this key .