protected function validateClasses($classes)
    {
        if (!is_array($classes)) {
            $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];

            throw new InvalidArgumentException("Breadcrumbs::{$trace}() only accepts strings or arrays.");
        }

        foreach ($classes as $key => $class) {
            if (!is_string($class)) {
                $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];

                throw new InvalidArgumentException(
                    "Breadcrumbs::{$trace}() was passed an array, but at least one of the values " .
                    "was not a string: \$classes['{$key}'] = " . print_r($class, true)
                );
            }
        }
    }
protected function validateClasses($classes)
    {
        if (!is_array($classes)) {
            $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];

            throw new InvalidArgumentException("Breadcrumbs::{$trace}() only accepts strings or arrays.");
        }

        foreach ($classes as $key => $class) {
            if (!is_string($class)) {
                $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];

                throw new InvalidArgumentException(
                    "Breadcrumbs::{$trace}() was passed an array, but at least one of the values " .
                    "was not a string: \$classes['{$key}'] = " . print_r($class, true)
                );
            }
        }
    }
protected function validateClasses ( $ classes ) { if ( ! is_array ( $ classes ) ) { $ trace = debug_backtrace ( DEBUG_BACKTRACE_IGNORE_ARGS , 3 ) [ 2 ] [ 'function' ] ; throw new InvalidArgumentException ( "Breadcrumbs::{$trace}() only accepts strings or arrays." ) ; } foreach ( $ classes as $ key => $ class ) { if ( ! is_string ( $ class ) ) { $ trace = debug_backtrace ( DEBUG_BACKTRACE_IGNORE_ARGS , 3 ) [ 2 ] [ 'function' ] ; throw new InvalidArgumentException ( "Breadcrumbs::{$trace}() was passed an array, but at least one of the values " . "was not a string: \$classes['{$key}'] = " . print_r ( $ class , true ) ) ; } } }
Validate the classes to ensure they have the right format.

@param array $classes The classes to validate.

@throws \InvalidArgumentException When the classes is not an array or a string.
Or when the class name is not a string.

@return void
Validate the classes to ensure they have the right format .