protected function globNames(
        /*# string */ $eventName,
        array $names
    )/*# : array */ {
        $result = [];
        foreach ($names as $n) {
            if ($n === '*' || $n === $eventName || $eventName === '') {
                $result[] = $n;
            } elseif (strpos($n, '*') !== false) {
                $regex = str_replace(array('.', '*'), array('[.]', '.*?'), $n);
                if (preg_match('/^'.$regex.'$/', $eventName)) {
                    $result[] = $n;
                }
            }
        }
        return $result;
    }
protected function globNames(
        /*# string */ $eventName,
        array $names
    )/*# : array */ {
        $result = [];
        foreach ($names as $n) {
            if ($n === '*' || $n === $eventName || $eventName === '') {
                $result[] = $n;
            } elseif (strpos($n, '*') !== false) {
                $regex = str_replace(array('.', '*'), array('[.]', '.*?'), $n);
                if (preg_match('/^'.$regex.'$/', $eventName)) {
                    $result[] = $n;
                }
            }
        }
        return $result;
    }
protected function globNames ( /*# string */ $ eventName , array $ names ) /*# : array */ { $ result = [ ] ; foreach ( $ names as $ n ) { if ( $ n === '*' || $ n === $ eventName || $ eventName === '' ) { $ result [ ] = $ n ; } elseif ( strpos ( $ n , '*' ) !== false ) { $ regex = str_replace ( array ( '.' , '*' ) , array ( '[.]' , '.*?' ) , $ n ) ; if ( preg_match ( '/^' . $ regex . '$/' , $ eventName ) ) { $ result [ ] = $ n ; } } } return $ result ; }
Return those globbing event names based on the given one

e.g.
Matching specific name 'login.MobileFail' with those '*',
'login.*', 'login.*Fail'

@param  string $eventName specific event name
@param  string[] $names name array to search thru
@return string[]
@access protected
Return those globbing event names based on the given one