mirror of
https://github.com/Respect/Validation.git
synced 2024-06-07 08:12:16 +02:00
Rename rule "Scalar" to "ScalarVal"
This commit is contained in:
parent
88865267d9
commit
1931da7570
|
@ -16,7 +16,7 @@ All notable changes of the Respect\Validation releases are documented in this fi
|
|||
- Create "Mimetype" rule (#361)
|
||||
- Create "Optional" rule (#423)
|
||||
- Create "ResourceType" rule (#397)
|
||||
- Create "Scalar" rule (#397)
|
||||
- Create "ScalarVal" rule (#397)
|
||||
- Create "Size" rule (#359)
|
||||
- Create "SubdivisionCode" rule for 252 countries (#411)
|
||||
- Create "VideoUrl" rule (#410)
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
# Scalar
|
||||
|
||||
- `v::scalar()`
|
||||
|
||||
Validates if the input is a scalar value.
|
||||
|
||||
```php
|
||||
v::scalar()->validate(array()); //false
|
||||
v::scalar()->validate(135.0); //true
|
||||
```
|
||||
|
||||
***
|
||||
See also:
|
||||
|
||||
* [Type](Type.md)
|
15
docs/ScalarVal.md
Normal file
15
docs/ScalarVal.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# ScalarVal
|
||||
|
||||
- `v::scalarVal()`
|
||||
|
||||
Validates if the input is a scalar value.
|
||||
|
||||
```php
|
||||
v::scalarVal()->validate(array()); //false
|
||||
v::scalarVal()->validate(135.0); //true
|
||||
```
|
||||
|
||||
***
|
||||
See also:
|
||||
|
||||
* [Type](Type.md)
|
|
@ -23,5 +23,5 @@ See also:
|
|||
* [IntVal](IntVal.md)
|
||||
* [ObjectType](ObjectType.md)
|
||||
* [ResourceType](ResourceType.md)
|
||||
* [Scalar](Scalar.md)
|
||||
* [ScalarVal](ScalarVal.md)
|
||||
* [StringType](StringType.md)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* [Numeric](Numeric.md)
|
||||
* [ObjectType](ObjectType.md)
|
||||
* [ResourceType](ResourceType.md)
|
||||
* [Scalar](Scalar.md)
|
||||
* [ScalarVal](ScalarVal.md)
|
||||
* [StringType](StringType.md)
|
||||
* [TrueVal](TrueVal.md)
|
||||
* [Type](Type.md)
|
||||
|
@ -263,7 +263,7 @@
|
|||
* [Regex](Regex.md)
|
||||
* [ResourceType](ResourceType.md)
|
||||
* [Roman](Roman.md)
|
||||
* [Scalar](Scalar.md)
|
||||
* [ScalarVal](ScalarVal.md)
|
||||
* [Sf](Sf.md)
|
||||
* [Size](Size.md)
|
||||
* [Slug](Slug.md)
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Respect\Validation\Exceptions;
|
|||
/**
|
||||
* @author Henrique Moody <henriquemoody@gmail.com>
|
||||
*/
|
||||
class ScalarException extends ValidationException
|
||||
class ScalarValException extends ValidationException
|
||||
{
|
||||
/**
|
||||
* @var array
|
|
@ -14,7 +14,7 @@ namespace Respect\Validation\Rules;
|
|||
/**
|
||||
* @author Henrique Moody <henriquemoody@gmail.com>
|
||||
*/
|
||||
class Scalar extends AbstractRule
|
||||
class ScalarVal extends AbstractRule
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
|
@ -104,7 +104,7 @@ use Respect\Validation\Rules\Key;
|
|||
* @method static Validator regex(string $regex)
|
||||
* @method static Validator resourceType()
|
||||
* @method static Validator roman()
|
||||
* @method static Validator scalar()
|
||||
* @method static Validator scalarVal()
|
||||
* @method static Validator sf(string $name, array $params = null)
|
||||
* @method static Validator size(string $minSize = null, string $maxSize = null)
|
||||
* @method static Validator slug()
|
||||
|
|
|
@ -13,16 +13,16 @@ namespace Respect\Validation\Rules;
|
|||
|
||||
/**
|
||||
* @group rule
|
||||
* @covers Respect\Validation\Rules\Scalar
|
||||
* @covers Respect\Validation\Exceptions\ScalarException
|
||||
* @covers Respect\Validation\Rules\ScalarVal
|
||||
* @covers Respect\Validation\Exceptions\ScalarValException
|
||||
*/
|
||||
class ScalarTest extends \PHPUnit_Framework_TestCase
|
||||
class ScalarValTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $rule;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->rule = new Scalar();
|
||||
$this->rule = new ScalarVal();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,7 +42,7 @@ class ScalarTest extends \PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException Respect\Validation\Exceptions\ScalarException
|
||||
* @expectedException Respect\Validation\Exceptions\ScalarValException
|
||||
* @expectedExceptionMessage null must be a scalar value
|
||||
*/
|
||||
public function testShouldThrowScalarExceptionWhenChecking()
|
Loading…
Reference in a new issue