original_string: 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}));
          }
      }
code: 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}));
          }
      }
code_tokens: 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 } ) ) ; } }
docstring: 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
docstring_tokens: Validate an Element before saving it .