Neos\Eel\Helper\JsonHelper::stringify PHP Method

stringify() public method

JSON encode the given value
public stringify ( mixed $value ) : string
$value mixed
return string
    public function stringify($value)
    {
        return json_encode($value);
    }

Usage Example

 /**
  * @test
  * @dataProvider stringifyExamples
  */
 public function stringifyWorks($value, $expected)
 {
     $helper = new JsonHelper();
     $result = $helper->stringify($value);
     $this->assertEquals($expected, $result);
 }