int $maxDepth The maximum serialization depth:
public function __construct(int $maxDepth) { if ($maxDepth <= 0) { throw new InvalidArgumentException(\sprintf('Parameter given to "%s" must be a positive integer.', static::class)); } }