Skip to content

Commit

Permalink
Remove support for undocumented baseXX() shortcut
Browse files Browse the repository at this point in the history
Previously undocumented, this feature is now removed to improve
each chain call.
  • Loading branch information
Alexandre Gaigalas committed Jan 14, 2015
1 parent ecd2cc9 commit a8d1c94
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
5 changes: 0 additions & 5 deletions library/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ public function __call($method, $arguments)
return $arguments ? static::buildRule($method, $arguments) : new Rules\Not($this);
}

if (isset($method{4}) &&
substr($method, 0, 4) == 'base' && preg_match('@^base([0-9]{1,2})$@', $method, $match)) {
return $this->addRule(static::buildRule('base', array($match[1])));
}

return $this->addRule(static::buildRule($method, $arguments));
}

Expand Down
30 changes: 0 additions & 30 deletions tests/library/Respect/Validation/Rules/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ class BaseTest extends \PHPUnit_Framework_TestCase
{
protected $object;

protected function setUp()
{

}

/**
* @dataProvider providerForBase
*
Expand All @@ -24,20 +19,6 @@ public function testBase($base, $input)
$this->assertTrue($object->assert($input));
}

/**
* @dataProvider providerForBase
*
*/
public function testBaseShortcut($base, $input)
{
$method = 'base' . $base;
$object = v::$method();

$this->assertTrue($object->__invoke($input));
$this->assertTrue($object->check($input));
$this->assertTrue($object->assert($input));
}

/**
* @dataProvider providerForInvalidBase
*
Expand All @@ -48,17 +29,6 @@ public function testInvalidBase($base, $input)
$this->assertFalse($object->__invoke($input));
}

/**
* @dataProvider providerForInvalidBase
*
*/
public function testInvalidBaseShortcut($base, $input)
{
$method = 'base' . $base;
$object = v::$method();
$this->assertFalse($object->__invoke($input));
}

/**
* @dataProvider providerForExceptionBase
* @expectedException Respect\Validation\Exceptions\BaseException
Expand Down

0 comments on commit a8d1c94

Please sign in to comment.