2016-09-03 04:24:22 +05:30
|
|
|
<?php
|
|
|
|
namespace api\modules\session\validators;
|
|
|
|
|
|
|
|
use api\modules\session\exceptions\IllegalArgumentException;
|
|
|
|
|
|
|
|
/**
|
2019-07-15 04:29:56 +05:30
|
|
|
* For this module, it is not important for us what the error is: if at least one parameter is missing,
|
|
|
|
* we immediately throw an exception and that's it.
|
2016-09-03 04:24:22 +05:30
|
|
|
*/
|
|
|
|
class RequiredValidator extends \yii\validators\RequiredValidator {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $value
|
|
|
|
* @throws \api\modules\session\exceptions\SessionServerException
|
|
|
|
*/
|
2024-12-02 15:40:55 +05:30
|
|
|
protected function validateValue($value): ?array {
|
2016-09-03 04:24:22 +05:30
|
|
|
if (parent::validateValue($value) !== null) {
|
|
|
|
throw new IllegalArgumentException();
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|