expected = $expected; $this->found = $found; $this->location = $location; } /** * JSON serialization similar to the JavaScript SyntaxError, for testing * @return array */ public function jsonSerialize() { return [ 'name' => 'SyntaxError', 'message' => $this->message, 'expected' => $this->expected, 'found' => $this->found, 'location' => $this->location ]; } }