namespace Org\Mxchange\CoreFramework\Helper\Captcha;
// Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Crypto\RandomNumber\RandomNumberGenerator;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\BaseHelper;
+use Org\Mxchange\CoreFramework\Helper\Helper;
+use Org\Mxchange\CoreFramework\Traits\Helper\HelperTrait;
/**
* A general captcha
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
-<<<<<<< HEAD:framework/main/classes/helper/captcha/class_BaseCaptcha.php
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
-=======
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
->>>>>>> Some updates::inc/main/classes/helper/captcha/class_BaseCaptcha.php
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-abstract class BaseCaptcha extends BaseHelper {
+abstract class BaseCaptcha extends BaseHelper implements Helper {
+ // Load traits
+ use HelperTrait;
+
+ /**
+ * Instance of a RNG
+ */
+ private $rngInstance = NULL;
+
/**
* Protected constructor
*
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
+ /**
+ * Setter for RNG instance
+ *
+ * @param $rngInstance An instance of a random number generator (RNG)
+ * @return void
+ */
+ protected final function setRngInstance (RandomNumberGenerator $rngInstance) {
+ $this->rngInstance = $rngInstance;
+ }
+
+ /**
+ * Getter for RNG instance
+ *
+ * @return $rngInstance An instance of a random number generator (RNG)
+ */
+ public final function getRngInstance () {
+ return $this->rngInstance;
+ }
+
/**
* Initializes the random number generator (RNG)
*