sequence() public static method

This is typically used to generate unique names such as usernames. The parameter may be a function that receives a counter value each time the entity is created or it may be a string. If the parameter is a string string containing "%d" then it will be replaced by the counter value. If the string does not contain "%d" then the number is simply appended to the parameter.
public static sequence ( callable | string $funcOrString, integer $firstNum = 1 ) : callable
$funcOrString callable | string The function or pattern to generate a value from.
$firstNum integer The first number to use.
return callable
 /**
  * @test
  */
 public function sequenceGeneratorCanTakeAStringToAppendTo()
 {
     $this->factory->defineEntity('SpaceShip', array('name' => FieldDef::sequence("Gamma ")));
     $this->assertEquals('Gamma 1', $this->factory->get('SpaceShip')->getName());
     $this->assertEquals('Gamma 2', $this->factory->get('SpaceShip')->getName());
     $this->assertEquals('Gamma 3', $this->factory->get('SpaceShip')->getName());
     $this->assertEquals('Gamma 4', $this->factory->get('SpaceShip')->getName());
 }