This class is intended to be used to generate numeral captchas as such as: Example: Give me the answer to "54 + 2" to prove that you are human.
The answer to the numeral operation we are about to do.
This variable holds the first number of the numeral operation we are about to generate.
This variable holds the maximum range value default set to "50"
This variable holds the minimum range value default set to "1"
This is the mathematical operation that we are displaying to the user.
This variable is basically the operation that we're going to be using in the numeral captcha we are about to generate.
The valid operators to use in the numeral captcha. We could use / and * but not yet.
This variable holds the value of the second variable of the operation we are about to generate for the captcha.
$complexityType = self::COMPLEXITY_ELEMENTARY], [integer
$minValue = 1], [integer
$maxValue = 50])
This function will add the firstNumber and the secondNumber value and then call setAnswer to set the answer value.
$firstNumber = null], [integer
$secondNumber = null])
This function executes a division based on the two numbers.
This function executes an exponentiation
This method will do a modulus operation between two numbers
This method will multiply two numbers
This function executes a substraction on the firstNumber and the secondNumber to then call $this->setAnswer to set the answer value.
If the firstnumber value is smaller than the secondnumber value then we regenerate the first number and regenerate the operation.
This function sets the first number of the operation by calling the generateNumber function that generates a random number.
This function takes the parameters that are in the $this->maxValue and $this->minValue and get the random number from them using mt_rand()
This function will call the setOperation() function to set the operation string that will be called to display the operation, and call the function necessary depending on which operation is set by this->operator.
This function sets the operation operator by getting the array value of an array_rand() of the $this->operators() array.
This function sets the second number of the operation by calling generateNumber()
This function will retrieve the answer value from this->answer and return it so we can then display it to the user.
This function will get the first number value from $this->firstNumber
This function will get the operation string from $this->operation
This function will return the second number value
This function prepare configure the values to generate the captcha
This function will accept the parameters which is basically the result of the function we have done and it will set $this->answer with it.
This function sets the first number to the value passed to the function
$type = null])
This variable sets the operation variable by taking the firstNumber, secondNumber and operator
$minValue = '1'])
This function give the developer the ability to set the range minimum value so the operations can be bigger, smaller, etc.
This function sets the second number with the value passed to it.