public function when(string $type, array $config = []): self
    {
        if (! isset($this->data['on'][$type])) {
            $this->data['on'][$type] = [];
        }

        $this->data['on'][$type] = \array_merge($this->data['on'][$type], $config);

        return $this;
    }