public function __construct(JsonValidator $validator = null) { $this->validator = $validator ?: new JsonValidator(); }