private function findNonExistingUserName()
    {
        for ($i = 0; $i < 20; ++$i) {
            $username = uniqid('User#', true);
            if (!$this->checkUserExistenceByUsername($username)) {
                return $username;
            }
        }

        throw new \Exception('Possible endless loop when attempting to find a new name for User.');
    }
private function findNonExistingUserName()
    {
        for ($i = 0; $i < 20; ++$i) {
            $username = uniqid('User#', true);
            if (!$this->checkUserExistenceByUsername($username)) {
                return $username;
            }
        }

        throw new \Exception('Possible endless loop when attempting to find a new name for User.');
    }
private function findNonExistingUserName ( ) { for ( $ i = 0 ; $ i < 20 ; ++ $ i ) { $ username = uniqid ( 'User#' , true ) ; if ( ! $ this -> checkUserExistenceByUsername ( $ username ) ) { return $ username ; } } throw new \ Exception ( 'Possible endless loop when attempting to find a new name for User.' ) ; }
Find a non existing User name.

@return string A not used name

@throws \Exception Possible endless loop
Find a non existing User name .