// Import framework stuff
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
+use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @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
*
*
* @return void
*/
- protected function __construct () {
+ private function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
}
// Day of birth set?
if (!$requestInstance->isRequestElementSet('birth_day')) {
// Day of birth isn't set
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('day_of_birth_unset');
- } // END - if
+ }
// Month of birth set?
if (!$requestInstance->isRequestElementSet('birth_month')) {
// Month of birth isn't set
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('month_of_birth_unset');
- } // END - if
+ }
// Year of birth set?
if (!$requestInstance->isRequestElementSet('birth_year')) {
// Year of birth isn't set
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('year_of_birth_unset');
- } // END - if
+ }
// Is the request still valid?
if (!$requestInstance->isRequestValid()) {
// Abort here
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
- } // END - if
+ }
// Now comes the final check
$birthCheck = mktime(
// Is there a number or such? (we don't care about the value itself here)
if (empty($birthCheck)) {
// Validation has failed
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('birthday_invalid');
// Abort here
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
- } // END - if
+ }
}
}