Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortening identical statements #18922

Merged
merged 1 commit into from
Oct 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions framework/validators/CompareValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The value being compared with can be another attribute value
* (specified via [[compareAttribute]]) or a constant (specified via
* [[compareValue]]. When both are specified, the latter takes
* [[compareValue]]). When both are specified, the latter takes
* precedence. If neither is specified, the attribute will be compared
* with another attribute whose name is by appending "_repeat" to the source
* attribute name.
Expand Down Expand Up @@ -105,14 +105,10 @@ public function init()
if ($this->message === null) {
switch ($this->operator) {
case '==':
$this->message = Yii::t('yii', '{attribute} must be equal to "{compareValueOrAttribute}".');
break;
case '===':
$this->message = Yii::t('yii', '{attribute} must be equal to "{compareValueOrAttribute}".');
break;
case '!=':
$this->message = Yii::t('yii', '{attribute} must not be equal to "{compareValueOrAttribute}".');
break;
case '!==':
$this->message = Yii::t('yii', '{attribute} must not be equal to "{compareValueOrAttribute}".');
break;
Expand Down