svn: /pear/packages/Text_CAPTCHA_Numeral/trunk/ Text/CAPTCHA/Numeral.php package.xml

From: Date: Sun, 19 Sep 2010 08:59:21 +0000
Subject: svn: /pear/packages/Text_CAPTCHA_Numeral/trunk/ Text/CAPTCHA/Numeral.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-60369@lists.php.net to get a copy of this message
cweiske Sun, 19 Sep 2010 08:59:21 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=303552 Log: Fix bug #17428: Shorten constant names Bug: http://pear.php.net/bugs/17428 (unknown) Changed paths: U pear/packages/Text_CAPTCHA_Numeral/trunk/Text/CAPTCHA/Numeral.php U pear/packages/Text_CAPTCHA_Numeral/trunk/package.xml Modified: pear/packages/Text_CAPTCHA_Numeral/trunk/Text/CAPTCHA/Numeral.php =================================================================== --- pear/packages/Text_CAPTCHA_Numeral/trunk/Text/CAPTCHA/Numeral.php 2010-09-19 08:49:42 UTC (rev 303551) +++ pear/packages/Text_CAPTCHA_Numeral/trunk/Text/CAPTCHA/Numeral.php 2010-09-19 08:59:21 UTC (rev 303552) @@ -157,8 +157,7 @@ * @access public * */ - const TEXT_CAPTCHA_NUMERAL_COMPLEXITY_ELEMENTARY = 1; - + const COMPLEXITY_ELEMENTARY = 1; /** * A constant that indicates the complexity of mathematical operations @@ -166,15 +165,35 @@ * @access public * */ - const TEXT_CAPTCHA_NUMERAL_COMPLEXITY_HIGH_SCHOOL = 2; - - + const COMPLEXITY_HIGH_SCHOOL = 2; + /** * A constant that indicates the complexity of mathematical operations * * @access public * */ + const COMPLEXITY_UNIVERSITY = 4; + + /** + * Kept for backwards compatibility only; use the short constant. + * + * @deprecated + */ + const TEXT_CAPTCHA_NUMERAL_COMPLEXITY_ELEMENTARY = 1; + + /** + * Kept for backwards compatibility only; use the short constant. + * + * @deprecated + */ + const TEXT_CAPTCHA_NUMERAL_COMPLEXITY_HIGH_SCHOOL = 2; + + /** + * Kept for backwards compatibility only; use the short constant. + * + * @deprecated + */ const TEXT_CAPTCHA_NUMERAL_COMPLEXITY_UNIVERSITY = 4; @@ -186,21 +205,21 @@ * * @param constant $complexityType */ - public function __construct($complexityType = self::TEXT_CAPTCHA_NUMERAL_COMPLEXITY_ELEMENTARY, $minValue = 1, $maxValue = 50) + public function __construct($complexityType = self::COMPLEXITY_ELEMENTARY, $minValue = 1, $maxValue = 50) { $this->minValue = (int)$minValue; $this->maxValue = (int)$maxValue; switch ($complexityType) { - case self::TEXT_CAPTCHA_NUMERAL_COMPLEXITY_HIGH_SCHOOL: + case self::COMPLEXITY_HIGH_SCHOOL: $this->operators[] = '*'; if ($this->maxValue < 70) { $this->maxValue = '70'; } break; - case self::TEXT_CAPTCHA_NUMERAL_COMPLEXITY_UNIVERSITY: + case self::COMPLEXITY_UNIVERSITY: $this->operators[] = '*'; $this->operators[] = '%'; $this->operators[] = '/'; @@ -211,7 +230,7 @@ } break; - case self::TEXT_CAPTCHA_NUMERAL_COMPLEXITY_ELEMENTARY: + case self::COMPLEXITY_ELEMENTARY: default: break; } Modified: pear/packages/Text_CAPTCHA_Numeral/trunk/package.xml =================================================================== --- pear/packages/Text_CAPTCHA_Numeral/trunk/package.xml 2010-09-19 08:49:42 UTC (rev 303551) +++ pear/packages/Text_CAPTCHA_Numeral/trunk/package.xml 2010-09-19 08:59:21 UTC (rev 303552) @@ -30,6 +30,7 @@ <notes> - Added complexity in numbers and possibility to use larger numbers. - New way of handling operations with different levels of complexity. +- Fix bug #17428: Shorten constant names [cweiske] </notes> <contents> <dir baseinstalldir="/" name="/"> @@ -68,6 +69,7 @@ <notes> - Added complexity in numbers and possibility to use larger numbers. - New way of handling operations with different levels of complexity. +- Fix bug #17428: Shorten constant names [cweiske] </notes> </release> </changelog>

« previous php.pear.cvs (#60369) next »