src/BreadcrumbsTrait.php
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}));
        }
    }
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}));
        }
    }
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 } ) ) ; } }
Validate an Element before saving it.

@param string $type The type from where we must validate the Element.
@param string $element The Element to validate.

@throws \InvalidArgumentException When the validation fail.

@return void
Validate an Element before saving it .