Rename rule "Resource" to "ResourceType"

This commit is contained in:
Henrique Moody 2015-10-07 12:33:39 -03:00
parent 598bfa2843
commit 88865267d9
8 changed files with 16 additions and 16 deletions

View file

@ -15,7 +15,7 @@ All notable changes of the Respect\Validation releases are documented in this fi
- Create "KeySet" rule (#374)
- Create "Mimetype" rule (#361)
- Create "Optional" rule (#423)
- Create "Resource" rule (#397)
- Create "ResourceType" rule (#397)
- Create "Scalar" rule (#397)
- Create "Size" rule (#359)
- Create "SubdivisionCode" rule for 252 countries (#411)

View file

@ -1,11 +1,11 @@
# Resource
# ResourceType
- `v::resource()`
- `v::resourceType()`
Validates if the input is a resource.
```php
v::resource()->validate(fopen('/path/to/file.txt', 'w')); //true
v::resourceType()->validate(fopen('/path/to/file.txt', 'w')); //true
```
***

View file

@ -22,6 +22,6 @@ See also:
* [Instance](Instance.md)
* [IntVal](IntVal.md)
* [ObjectType](ObjectType.md)
* [Resource](Resource.md)
* [ResourceType](ResourceType.md)
* [Scalar](Scalar.md)
* [StringType](StringType.md)

View file

@ -13,7 +13,7 @@
* [NullType](NullType.md)
* [Numeric](Numeric.md)
* [ObjectType](ObjectType.md)
* [Resource](Resource.md)
* [ResourceType](ResourceType.md)
* [Scalar](Scalar.md)
* [StringType](StringType.md)
* [TrueVal](TrueVal.md)
@ -81,7 +81,7 @@
* [Prnt](Prnt.md)
* [Punct](Punct.md)
* [Regex](Regex.md)
* [Resource](Resource.md)
* [ResourceType](ResourceType.md)
* [Slug](Slug.md)
* [Space](Space.md)
* [StartsWith](StartsWith.md)
@ -261,7 +261,7 @@
* [Punct](Punct.md)
* [Readable](Readable.md)
* [Regex](Regex.md)
* [Resource](Resource.md)
* [ResourceType](ResourceType.md)
* [Roman](Roman.md)
* [Scalar](Scalar.md)
* [Sf](Sf.md)

View file

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

View file

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

View file

@ -102,7 +102,7 @@ use Respect\Validation\Rules\Key;
* @method static Validator punct(string $additionalChars = null)
* @method static Validator readable()
* @method static Validator regex(string $regex)
* @method static Validator resource()
* @method static Validator resourceType()
* @method static Validator roman()
* @method static Validator scalar()
* @method static Validator sf(string $name, array $params = null)

View file

@ -13,16 +13,16 @@ namespace Respect\Validation\Rules;
/**
* @group rule
* @covers Respect\Validation\Rules\Resource
* @covers Respect\Validation\Exceptions\ResourceException
* @covers Respect\Validation\Rules\ResourceType
* @covers Respect\Validation\Exceptions\ResourceTypeException
*/
class ResourceTest extends \PHPUnit_Framework_TestCase
class ResourceTypeTest extends \PHPUnit_Framework_TestCase
{
protected $rule;
protected function setUp()
{
$this->rule = new Resource();
$this->rule = new ResourceType();
}
/**
@ -42,7 +42,7 @@ class ResourceTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException Respect\Validation\Exceptions\ResourceException
* @expectedException Respect\Validation\Exceptions\ResourceTypeException
* @expectedExceptionMessage "Something" must be a resource
*/
public function testShouldThrowResourceExceptionWhenChecking()