Skip to content

Commit ff5736f

Browse files
committed
fix constants
1 parent 63dcaa3 commit ff5736f

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/Variable.php

+4-12
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,21 @@
1212
*/
1313
class Variable
1414
{
15-
const EXCEPTION_CAST_TEXT = 'Can not cast ${{variable}} to {{type}}';
16-
1715
const EXCEPTION_CLASS = '\InvalidArgumentException';
1816

19-
const EXCEPTION_LENGTH_TEXT_NEGATIVE = '${{variable}} must have not length {{value}}';
20-
2117
const EXCEPTION_LENGTH_TEXT_POSITIVE = '${{variable}} must have length {{value}}';
2218

2319
const EXCEPTION_TYPE_TEXT_NEGATIVE = 'Param ${{variable}} must be not {{type}}';
2420

2521
const EXCEPTION_TYPE_TEXT_POSITIVE = 'Param ${{variable}} must be {{type}}';
2622

27-
const EXCEPTION_VALUE_IN_ARRAY_NEGATIVE = '${{variable}} must be not in range {{value}}';
28-
2923
const EXCEPTION_VALUE_IN_ARRAY_POSITIVE = '${{variable}} out of range {{value}}';
3024

3125
const EXCEPTION_VALUE_TEXT_NEGATIVE = 'Param ${{variable}} must be not {{value}}';
3226

3327
const EXCEPTION_VALUE_TEXT_POSITIVE = 'Param ${{variable}} must be {{value}}';
3428

35-
const EXCEPTION_VALUE_REG_EXP_NEGATIVE = 'Param ${{variable}} must apply pattern {{pattern}}';
36-
37-
const EXCEPTION_VALUE_REG_EXP_POSITIVE = 'Param ${{variable}} must not apply pattern {{pattern}}';
29+
const EXCEPTION_VALUE_PATTERN_POSITIVE = 'Param ${{variable}} must apply pattern {{pattern}}';
3830

3931
/** @var Variable */
4032
protected static $validator;
@@ -424,7 +416,7 @@ public function isEmpty()
424416
public function notEmpty()
425417
{
426418
if (empty($this->value)) {
427-
throw $this->buildException(self::EXCEPTION_TYPE_TEXT_NEGATIVE, ['{{type}}' => 'empty']);
419+
throw $this->buildException(self::EXCEPTION_VALUE_TEXT_NEGATIVE, ['{{type}}' => 'empty']);
428420
}
429421

430422
return $this;
@@ -587,7 +579,7 @@ public function match($pattern)
587579
}
588580

589581
if ($checkResult === 0) {
590-
throw $this->buildException(self::EXCEPTION_VALUE_REG_EXP_POSITIVE, ['{{pattern}}' => $pattern]);
582+
throw $this->buildException(self::EXCEPTION_VALUE_PATTERN_POSITIVE, ['{{pattern}}' => $pattern]);
591583
}
592584

593585
return $this;
@@ -612,7 +604,7 @@ public function glob($pattern)
612604
}
613605

614606
if (!fnmatch($pattern, $this->value)) {
615-
throw $this->buildException(self::EXCEPTION_VALUE_REG_EXP_NEGATIVE, ['{{pattern}}' => $pattern]);
607+
throw $this->buildException(self::EXCEPTION_VALUE_PATTERN_POSITIVE, ['{{pattern}}' => $pattern]);
616608
}
617609

618610
return $this;

0 commit comments

Comments
 (0)