protected function validateElement(string $type, string $element)
    {
        if (!in_array($element, $this->{$type})) {
            $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function'];

            throw new InvalidArgumentException("Breadcrumbs::{$trace} was passed \"$element\", but " .
            "this is not a valid element. Allowed list : " . implode(' ', $this->{$type}));
        }
    }