Apply "SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants"

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
Henrique Moody 2019-02-09 12:07:38 +01:00
parent cc20a442a1
commit cb24cc97d2
No known key found for this signature in database
GPG key ID: 221E9281655813A6
15 changed files with 21 additions and 20 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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();

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -45,6 +45,6 @@ final class VideoUrlException extends ValidationException
return self::SERVICE;
}
return static::STANDARD;
return self::STANDARD;
}
}

View file

@ -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" />