# CodeGenerator Class Reference
[CAPTCHA's implementation]

List of all members.

## Public Member Functions

| generate ()
| setLength ($length)
| setLowerAllowed ($lowerAllowed=true)
| setUpperAllowed ($upperAllowed=true)
| setSimilarAllowed ($similarAllowed=true)
| setNumbersAllowed ($numbersAllowed=true)
| setCharactersAllowed ($charactersAllowed=true)

## Static Public Member Functions

static | create ()

## Private Member Functions

| generateOneSymbol ()
| randomNumber ()
| randomChar ()

## Private Attributes

| $length = null
| $lowerAllowed = true
| $upperAllowed = true
| $numbersAllowed = true
| $similarAllowed = true

## Static Private Attributes

static | $similarSymbols = array('0', 'o', '1', 'l')

## Detailed Description

Definition at line 15 of file CodeGenerator.class.php.

## Member Function Documentation

static CodeGenerator::create | ( |  | ) | `[static]`

Returns:
  CodeGenerator

Definition at line 29 of file CodeGenerator.class.php.

CodeGenerator::generate | ( |  | ) |

Definition at line 34 of file CodeGenerator.class.php.

References generateOneSymbol().

Here is the call graph for this function:

CodeGenerator::generateOneSymbol | ( |  | ) | `[private]`

Definition at line 105 of file CodeGenerator.class.php.

References Assert::isTrue(), randomChar(), and randomNumber().

Referenced by generate().

Here is the call graph for this function:

CodeGenerator::randomChar | ( |  | ) | `[private]`

Definition at line 144 of file CodeGenerator.class.php.

Referenced by generateOneSymbol().

CodeGenerator::randomNumber | ( |  | ) | `[private]`

Definition at line 139 of file CodeGenerator.class.php.

Referenced by generateOneSymbol().

CodeGenerator::setCharactersAllowed | ( | $ | charactersAllowed = `true` | ) |

Returns:
  CodeGenerator

Definition at line 97 of file CodeGenerator.class.php.

References setLowerAllowed(), and setUpperAllowed().

Here is the call graph for this function:

CodeGenerator::setLength | ( | $ | length | ) |

Returns:
  CodeGenerator

Definition at line 47 of file CodeGenerator.class.php.

References $length.

CodeGenerator::setLowerAllowed | ( | $ | lowerAllowed = `true` | ) |

Returns:
  CodeGenerator

Definition at line 57 of file CodeGenerator.class.php.

References $lowerAllowed.

Referenced by setCharactersAllowed().

CodeGenerator::setNumbersAllowed | ( | $ | numbersAllowed = `true` | ) |

Returns:
  CodeGenerator

Definition at line 87 of file CodeGenerator.class.php.

References $numbersAllowed.

CodeGenerator::setSimilarAllowed | ( | $ | similarAllowed = `true` | ) |

Returns:
  CodeGenerator

Definition at line 77 of file CodeGenerator.class.php.

References $similarAllowed.

CodeGenerator::setUpperAllowed | ( | $ | upperAllowed = `true` | ) |

Returns:
  CodeGenerator

Definition at line 67 of file CodeGenerator.class.php.

References $upperAllowed.

Referenced by setCharactersAllowed().

## Member Data Documentation

CodeGenerator::$length = null`[private]`

Definition at line 17 of file CodeGenerator.class.php.

Referenced by setLength().

CodeGenerator::$lowerAllowed = true`[private]`

Definition at line 19 of file CodeGenerator.class.php.

Referenced by setLowerAllowed().

CodeGenerator::$numbersAllowed = true`[private]`

Definition at line 21 of file CodeGenerator.class.php.

Referenced by setNumbersAllowed().

CodeGenerator::$similarAllowed = true`[private]`

Definition at line 22 of file CodeGenerator.class.php.

Referenced by setSimilarAllowed().

CodeGenerator::$similarSymbols = array('0', 'o', '1', 'l')`[static, private]`

Definition at line 24 of file CodeGenerator.class.php.

CodeGenerator::$upperAllowed = true`[private]`

Definition at line 20 of file CodeGenerator.class.php.

Referenced by setUpperAllowed().

The documentation for this class was generated from the following file:

- main/Utils/TuringTest/CodeGenerator.class.php