original_string: public function generate($suggestion = null)
      {
          if (null !== $suggestion) {
              $this->dataStore->storeIdentity($suggestion, $this->mob);
  
              return $suggestion;
          }
  
          $exceptions = array();
          for ($i = 0; $i <= $this->maxRetries; $i++) {
              $generatedIdentity = null;
              try {
                  $generatedIdentity = $this->generator->generateIdentity();
                  $this->dataStore->storeIdentity($generatedIdentity, $this->mob);
  
                  return $generatedIdentity;
              } catch (NonUniqueIdentityException $e) {
                  // We expect non unique identity exceptions so this is fine.
                  // Collect them and move on and try again if we still have
                  // some tries left.
                  $exceptions[] = $e;
              } catch (\Exception $e) {
                  // All other exceptions are unexpected.
                  throw new GenerateException($generatedIdentity, $this->mob, $exceptions, $e);
              }
          }
  
          throw new GenerateException(null, $this->mob, $exceptions);
      }
code: public function generate($suggestion = null)
      {
          if (null !== $suggestion) {
              $this->dataStore->storeIdentity($suggestion, $this->mob);
  
              return $suggestion;
          }
  
          $exceptions = array();
          for ($i = 0; $i <= $this->maxRetries; $i++) {
              $generatedIdentity = null;
              try {
                  $generatedIdentity = $this->generator->generateIdentity();
                  $this->dataStore->storeIdentity($generatedIdentity, $this->mob);
  
                  return $generatedIdentity;
              } catch (NonUniqueIdentityException $e) {
                  // We expect non unique identity exceptions so this is fine.
                  // Collect them and move on and try again if we still have
                  // some tries left.
                  $exceptions[] = $e;
              } catch (\Exception $e) {
                  // All other exceptions are unexpected.
                  throw new GenerateException($generatedIdentity, $this->mob, $exceptions, $e);
              }
          }
  
          throw new GenerateException(null, $this->mob, $exceptions);
      }
code_tokens: public function generate ( $ suggestion = null ) { if ( null !== $ suggestion ) { $ this -> dataStore -> storeIdentity ( $ suggestion , $ this -> mob ) ; return $ suggestion ; } $ exceptions = array ( ) ; for ( $ i = 0 ; $ i <= $ this -> maxRetries ; $ i ++ ) { $ generatedIdentity = null ; try { $ generatedIdentity = $ this -> generator -> generateIdentity ( ) ; $ this -> dataStore -> storeIdentity ( $ generatedIdentity , $ this -> mob ) ; return $ generatedIdentity ; } catch ( NonUniqueIdentityException $ e ) { // We expect non unique identity exceptions so this is fine. // Collect them and move on and try again if we still have // some tries left. $ exceptions [ ] = $ e ; } catch ( \ Exception $ e ) { // All other exceptions are unexpected. throw new GenerateException ( $ generatedIdentity , $ this -> mob , $ exceptions , $ e ) ; } } throw new GenerateException ( null , $ this -> mob , $ exceptions ) ; }
docstring: Generate an identity string
  
  @param string|null $suggestion
  
  @return string
  
  @throws \Dflydev\IdentityGenerator\Exception\Exception
docstring_tokens: Generate an identity string