Rename rule "Scalar" to "ScalarVal"

This commit is contained in:
Henrique Moody 2015-10-07 12:35:25 -03:00
parent 88865267d9
commit 1931da7570
9 changed files with 27 additions and 27 deletions

View file

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

View file

@ -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
View 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)

View file

@ -23,5 +23,5 @@ See also:
* [IntVal](IntVal.md)
* [ObjectType](ObjectType.md)
* [ResourceType](ResourceType.md)
* [Scalar](Scalar.md)
* [ScalarVal](ScalarVal.md)
* [StringType](StringType.md)

View file

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

View file

@ -14,7 +14,7 @@ namespace Respect\Validation\Exceptions;
/**
* @author Henrique Moody <henriquemoody@gmail.com>
*/
class ScalarException extends ValidationException
class ScalarValException extends ValidationException
{
/**
* @var array

View file

@ -14,7 +14,7 @@ namespace Respect\Validation\Rules;
/**
* @author Henrique Moody <henriquemoody@gmail.com>
*/
class Scalar extends AbstractRule
class ScalarVal extends AbstractRule
{
/**
* {@inheritdoc}

View file

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

View file

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