src/Concerns/MocksApplicationServices.php
protected function wasDispatched($needle, array $haystack)
    {
        foreach ($haystack as $dispatched) {
            if ((is_string($dispatched) && ($dispatched === $needle || is_subclass_of($dispatched, $needle))) ||
                $dispatched instanceof $needle) {
                return true;
            }
        }

        return false;
    }
protected function wasDispatched($needle, array $haystack)
    {
        foreach ($haystack as $dispatched) {
            if ((is_string($dispatched) && ($dispatched === $needle || is_subclass_of($dispatched, $needle))) ||
                $dispatched instanceof $needle) {
                return true;
            }
        }

        return false;
    }
protected function wasDispatched ( $ needle , array $ haystack ) { foreach ( $ haystack as $ dispatched ) { if ( ( is_string ( $ dispatched ) && ( $ dispatched === $ needle || is_subclass_of ( $ dispatched , $ needle ) ) ) || $ dispatched instanceof $ needle ) { return true ; } } return false ; }
Check if the given class exists in an array of dispatched classes.

@param  string  $needle
@param  array  $haystack
@return bool
Check if the given class exists in an array of dispatched classes .