Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/2878'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions src/AbstractValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ public static function setDefaultTranslator(
Translator $translator = null, $textDomain = null
)
{
self::$defaultTranslator = $translator;
static::$defaultTranslator = $translator;
if (null !== $textDomain) {
self::setDefaultTranslatorTextDomain($textDomain);
}
Expand All @@ -493,7 +493,7 @@ public static function setDefaultTranslator(
*/
public static function getDefaultTranslator()
{
return self::$defaultTranslator;
return static::$defaultTranslator;
}

/**
Expand All @@ -503,7 +503,7 @@ public static function getDefaultTranslator()
*/
public static function hasDefaultTranslator()
{
return (bool) self::$defaultTranslator;
return (bool) static::$defaultTranslator;
}

/**
Expand All @@ -514,7 +514,7 @@ public static function hasDefaultTranslator()
*/
public static function setDefaultTranslatorTextDomain($textDomain = 'default')
{
self::$defaultTranslatorTextDomain = $textDomain;
static::$defaultTranslatorTextDomain = $textDomain;
}

/**
Expand All @@ -524,7 +524,7 @@ public static function setDefaultTranslatorTextDomain($textDomain = 'default')
*/
public static function getDefaultTranslatorTextDomain()
{
return self::$defaultTranslatorTextDomain;
return static::$defaultTranslatorTextDomain;
}

/**
Expand Down Expand Up @@ -556,7 +556,7 @@ public function isTranslatorEnabled()
*/
public static function getMessageLength()
{
return self::$messageLength;
return static::$messageLength;
}

/**
Expand All @@ -566,7 +566,7 @@ public static function getMessageLength()
*/
public static function setMessageLength($length = -1)
{
self::$messageLength = $length;
static::$messageLength = $length;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Digits.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public function isValid($value)
return false;
}

if (null === self::$filter) {
self::$filter = new DigitsFilter();
if (null === static::$filter) {
static::$filter = new DigitsFilter();
}

if ($this->getValue() !== self::$filter->filter($this->getValue())) {
if ($this->getValue() !== static::$filter->filter($this->getValue())) {
$this->error(self::NOT_DIGITS);
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Iban.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function setCountryCode($countryCode = null)
if ($countryCode !== null) {
$countryCode = (string) $countryCode;

if (!isset(self::$ibanRegex[$countryCode])) {
if (!isset(static::$ibanRegex[$countryCode])) {
throw new Exception\InvalidArgumentException(
"Country code '{$countryCode}' invalid by ISO 3166-1 or not supported"
);
Expand Down Expand Up @@ -234,19 +234,19 @@ public function isValid($value)
$countryCode = substr($value, 0, 2);
}

if (!array_key_exists($countryCode, self::$ibanRegex)) {
if (!array_key_exists($countryCode, static::$ibanRegex)) {
$this->setValue($countryCode);
$this->error(self::NOTSUPPORTED);
return false;
}

if (!$this->allowNonSepa && !in_array($countryCode, self::$sepaCountries)) {
if (!$this->allowNonSepa && !in_array($countryCode, static::$sepaCountries)) {
$this->setValue($countryCode);
$this->error(self::SEPANOTSUPPORTED);
return false;
}

if (!preg_match('/^' . self::$ibanRegex[$countryCode] . '$/', $value)) {
if (!preg_match('/^' . static::$ibanRegex[$countryCode] . '$/', $value)) {
$this->error(self::FALSEFORMAT);
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/StaticValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function setPluginManager(ValidatorPluginManager $plugins = null)
if ($plugins instanceof ValidatorPluginManager) {
$plugins->setShareByDefault(false);
}
self::$plugins = $plugins;
static::$plugins = $plugins;
}

/**
Expand All @@ -43,10 +43,10 @@ public static function setPluginManager(ValidatorPluginManager $plugins = null)
*/
public static function getPluginManager()
{
if (null === self::$plugins) {
if (null === static::$plugins) {
static::setPluginManager(new ValidatorPluginManager());
}
return self::$plugins;
return static::$plugins;
}

/**
Expand Down

0 comments on commit f033c86

Please sign in to comment.