protected static function extract($pattern)
    {
        if (str_contains($pattern, '|')) {
            $segements = explode('|', $pattern);

            $events[$segements[0]] = explode('.', $segements[1]);
        } else {
            $segements = explode('.', $pattern);

            $events[$segements[0]] = $segements[1];
        }

        return $events;
    }
protected static function extract($pattern)
    {
        if (str_contains($pattern, '|')) {
            $segements = explode('|', $pattern);

            $events[$segements[0]] = explode('.', $segements[1]);
        } else {
            $segements = explode('.', $pattern);

            $events[$segements[0]] = $segements[1];
        }

        return $events;
    }
protected static function extract ( $ pattern ) { if ( str_contains ( $ pattern , '|' ) ) { $ segements = explode ( '|' , $ pattern ) ; $ events [ $ segements [ 0 ] ] = explode ( '.' , $ segements [ 1 ] ) ; } else { $ segements = explode ( '.' , $ pattern ) ; $ events [ $ segements [ 0 ] ] = $ segements [ 1 ] ; } return $ events ; }
Extract events from string pattern.

@param string $pattern

@return array
Extract events from string pattern .