Issue #2204161 by sun: Remove deprecated drupal_valid_number_step().

8.0.x
webchick 2014-02-24 14:51:32 -08:00
parent e9f6125007
commit c1e2a47dcc
2 changed files with 3 additions and 26 deletions

View File

@ -622,29 +622,6 @@ function valid_url($url, $absolute = FALSE) {
return Url::isValid($url, $absolute);
}
/**
* Verifies that a number is a multiple of a given step.
*
* @see \Drupal\Component\Utility\Number::validStep()
*
* @param numeric $value
* The value that needs to be checked.
* @param numeric $step
* The step scale factor. Must be positive.
* @param numeric $offset
* (optional) An offset, to which the difference must be a multiple of the
* given step.
*
* @return bool
* TRUE if no step mismatch has occurred, or FALSE otherwise.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\Number::validStep().
*/
function valid_number_step($value, $step, $offset = 0.0) {
return Number::validStep($value, $step, $offset);
}
/**
* @} End of "defgroup validation".
*/

View File

@ -13,14 +13,14 @@ use Drupal\Component\Utility\Number;
use Drupal\Tests\UnitTestCase;
/**
* Tests number step validation by valid_number_step().
* Tests number step validation by Number::validStep().
*/
class NumberTest extends UnitTestCase {
public static function getInfo() {
return array(
'name' => 'Number step validation',
'description' => 'Tests number step validation by valid_number_step()',
'description' => 'Tests number step validation by Number::validStep()',
'group' => 'Common',
);
}
@ -43,7 +43,7 @@ class NumberTest extends UnitTestCase {
}
/**
* Tests valid_number_step() with offset.
* Tests Number::validStep() with offset.
*
* @param numeric $value
* The value argument for Number::validStep().