Neos.Neos/Classes/Command/UserCommandController.php
protected function findUsersByUsernamePattern($usernamePattern, $authenticationProviderName = null)
    {
        if (preg_match('/[\\?\\*\\{\\[]/u', $usernamePattern)) {
            return array_filter(
                $this->userService->getUsers()->toArray(),
                function ($user) use ($usernamePattern, $authenticationProviderName) {
                    return fnmatch($usernamePattern, $this->userService->getUsername($user, $authenticationProviderName));
                }
            );
        } else {
            $user = $this->userService->getUser($usernamePattern, $authenticationProviderName);
            if ($user instanceof User) {
                return [$user];
            }
        }
        return [];
    }
protected function findUsersByUsernamePattern($usernamePattern, $authenticationProviderName = null)
    {
        if (preg_match('/[\\?\\*\\{\\[]/u', $usernamePattern)) {
            return array_filter(
                $this->userService->getUsers()->toArray(),
                function ($user) use ($usernamePattern, $authenticationProviderName) {
                    return fnmatch($usernamePattern, $this->userService->getUsername($user, $authenticationProviderName));
                }
            );
        } else {
            $user = $this->userService->getUser($usernamePattern, $authenticationProviderName);
            if ($user instanceof User) {
                return [$user];
            }
        }
        return [];
    }
protected function findUsersByUsernamePattern ( $ usernamePattern , $ authenticationProviderName = null ) { if ( preg_match ( '/[\\?\\*\\{\\[]/u' , $ usernamePattern ) ) { return array_filter ( $ this -> userService -> getUsers ( ) -> toArray ( ) , function ( $ user ) use ( $ usernamePattern , $ authenticationProviderName ) { return fnmatch ( $ usernamePattern , $ this -> userService -> getUsername ( $ user , $ authenticationProviderName ) ) ; } ) ; } else { $ user = $ this -> userService -> getUser ( $ usernamePattern , $ authenticationProviderName ) ; if ( $ user instanceof User ) { return [ $ user ] ; } } return [ ] ; }
Find all users the match the given username with globbing support

@param string $usernamePattern pattern for the username of the users to find
@param string $authenticationProviderName Name of the authentication provider to use
@return array<User>
Find all users the match the given username with globbing support