mirror of
https://github.com/Respect/Validation.git
synced 2024-05-29 03:42:25 +02:00
Apply "SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
cc20a442a1
commit
cb24cc97d2
|
@ -44,6 +44,6 @@ final class AttributeException extends NestedValidationException implements NonO
|
|||
*/
|
||||
protected function chooseTemplate(): string
|
||||
{
|
||||
return $this->getParam('hasReference') ? static::INVALID : static::NOT_PRESENT;
|
||||
return $this->getParam('hasReference') ? self::INVALID : self::NOT_PRESENT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,9 +44,9 @@ final class CreditCardException extends ValidationException
|
|||
protected function chooseTemplate(): string
|
||||
{
|
||||
if (CreditCard::ANY === $this->getParam('brand')) {
|
||||
return static::STANDARD;
|
||||
return self::STANDARD;
|
||||
}
|
||||
|
||||
return static::BRANDED;
|
||||
return self::BRANDED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,6 @@ final class DateTimeException extends ValidationException
|
|||
*/
|
||||
protected function chooseTemplate(): string
|
||||
{
|
||||
return $this->getParam('format') ? static::FORMAT : static::STANDARD;
|
||||
return $this->getParam('format') ? self::FORMAT : self::STANDARD;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,6 @@ class FilteredValidationException extends ValidationException
|
|||
*/
|
||||
protected function chooseTemplate(): string
|
||||
{
|
||||
return $this->getParam('additionalChars') ? static::EXTRA : static::STANDARD;
|
||||
return $this->getParam('additionalChars') ? self::EXTRA : self::STANDARD;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,6 @@ class GroupedValidationException extends NestedValidationException
|
|||
$numRules = $this->getParam('passed');
|
||||
$numFailed = count($this->getChildren());
|
||||
|
||||
return $numRules === $numFailed ? static::NONE : static::SOME;
|
||||
return $numRules === $numFailed ? self::NONE : self::SOME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ final class IpException extends ValidationException
|
|||
protected function chooseTemplate(): string
|
||||
{
|
||||
if (!$this->getParam('range')) {
|
||||
return static::STANDARD;
|
||||
return self::STANDARD;
|
||||
}
|
||||
|
||||
return static::NETWORK_RANGE;
|
||||
return self::NETWORK_RANGE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@ final class KeyException extends NestedValidationException implements NonOmissib
|
|||
*/
|
||||
protected function chooseTemplate(): string
|
||||
{
|
||||
return $this->getParam('hasReference') ? static::INVALID : static::NOT_PRESENT;
|
||||
return $this->getParam('hasReference') ? self::INVALID : self::NOT_PRESENT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@ final class KeyNestedException extends NestedValidationException implements NonO
|
|||
*/
|
||||
protected function chooseTemplate(): string
|
||||
{
|
||||
return $this->getParam('hasReference') ? static::INVALID : static::NOT_PRESENT;
|
||||
return $this->getParam('hasReference') ? self::INVALID : self::NOT_PRESENT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class KeySetException extends GroupedValidationException implements NonOmissible
|
|||
protected function chooseTemplate(): string
|
||||
{
|
||||
if (0 === count($this->getChildren())) {
|
||||
return static::STRUCTURE;
|
||||
return self::STRUCTURE;
|
||||
}
|
||||
|
||||
return parent::chooseTemplate();
|
||||
|
|
|
@ -36,6 +36,6 @@ class KeyValueException extends ValidationException
|
|||
|
||||
protected function chooseTemplate(): string
|
||||
{
|
||||
return $this->getParam('component') ? static::COMPONENT : static::STANDARD;
|
||||
return $this->getParam('component') ? self::COMPONENT : self::STANDARD;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,17 +49,17 @@ final class LengthException extends ValidationException
|
|||
protected function chooseTemplate(): string
|
||||
{
|
||||
if (!$this->getParam('minValue')) {
|
||||
return static::GREATER;
|
||||
return self::GREATER;
|
||||
}
|
||||
|
||||
if (!$this->getParam('maxValue')) {
|
||||
return static::LOWER;
|
||||
return self::LOWER;
|
||||
}
|
||||
|
||||
if ($this->getParam('minValue') == $this->getParam('maxValue')) {
|
||||
return self::EXACT;
|
||||
}
|
||||
|
||||
return static::BOTH;
|
||||
return self::BOTH;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,6 @@ class OptionalException extends ValidationException
|
|||
|
||||
protected function chooseTemplate(): string
|
||||
{
|
||||
return $this->getParam('name') ? static::NAMED : static::STANDARD;
|
||||
return $this->getParam('name') ? self::NAMED : self::STANDARD;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,11 +46,11 @@ class SizeException extends NestedValidationException
|
|||
protected function chooseTemplate(): string
|
||||
{
|
||||
if (!$this->getParam('minValue')) {
|
||||
return static::GREATER;
|
||||
return self::GREATER;
|
||||
} elseif (!$this->getParam('maxValue')) {
|
||||
return static::LOWER;
|
||||
return self::LOWER;
|
||||
}
|
||||
|
||||
return static::BOTH;
|
||||
return self::BOTH;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,6 @@ final class VideoUrlException extends ValidationException
|
|||
return self::SERVICE;
|
||||
}
|
||||
|
||||
return static::STANDARD;
|
||||
return self::STANDARD;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
|
||||
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation" />
|
||||
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
|
||||
<rule ref="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants" />
|
||||
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference" />
|
||||
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" />
|
||||
<rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming" />
|
||||
|
|
Loading…
Reference in a new issue